Skip to content

Commit

Permalink
fs: allow mounting filesystems at /
Browse files Browse the repository at this point in the history
Previously, filesystems could not be mounted at '/' because
mount points were restricted to being at least 2 characters.

Since '/' corresponds to the standard POSIX root filesystem
location, reduce the minimum length of a mount point to
1 character.

With that, we can mount a POSIX root filesystem.

Signed-off-by: Chris Friedt <[email protected]>
  • Loading branch information
cfriedt authored and kartben committed Jan 10, 2025
1 parent 60da065 commit ec7d272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ int fs_mount(struct fs_mount_t *mp)

len = strlen(mp->mnt_point);

if ((len <= 1) || (mp->mnt_point[0] != '/')) {
if ((len == 0) || (mp->mnt_point[0] != '/')) {
LOG_ERR("invalid mount point!!");
return -EINVAL;
}
Expand Down

0 comments on commit ec7d272

Please sign in to comment.