Skip to content

Commit ec7d272

Browse files
cfriedtkartben
authored andcommitted
fs: allow mounting filesystems at /
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 <cfriedt@tenstorrent.com>
1 parent 60da065 commit ec7d272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/fs/fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ int fs_mount(struct fs_mount_t *mp)
686686

687687
len = strlen(mp->mnt_point);
688688

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

0 commit comments

Comments
 (0)