From 866dc69d26781d57541d689ab45c3cad8f917df9 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Fri, 27 Dec 2024 08:44:59 -0500 Subject: [PATCH] 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 --- subsys/fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/fs/fs.c b/subsys/fs/fs.c index 37781535f32e..d9117f6d0854 100644 --- a/subsys/fs/fs.c +++ b/subsys/fs/fs.c @@ -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; }