diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-09-25 09:56:24 +0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-10-02 07:52:33 +0200 |
commit | 05fba0a11557dfdc1b6895f4a3fb59165669e643 (patch) | |
tree | 570ebe8e81e6e6d21068d4210e728f359eb439bf | |
parent | 9d926f10b7ff4300a5dc36ecc52d061911d027d8 (diff) |
fs: support relative paths with FSCONFIG_SET_STRING
The fs_lookup_param did not consider the relative path for block device.
When we mount ext4 with journal_path option using relative path,
param->dirfd was not set which will cause mounting error.
This can be reproduced easily like this:
mke2fs -F -O journal_dev $JOURNAL_DEV -b 4096 100M
mkfs.ext4 -F -J device=$JOURNAL_DEV -b 4096 $FS_DEV
cd /dev; mount -t ext4 -o journal_path=`basename $JOURNAL_DEV` $FS_DEV $MNT
Fixes: 461c3af045d3 ("ext4: Change handle_mount_opt() to use fs_parameter")
Suggested-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20240925015624.3817878-1-lihongbo22@huawei.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r-- | fs/fs_parser.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fs_parser.c b/fs/fs_parser.c index 24727ec34e5a..698464f3e26a 100644 --- a/fs/fs_parser.c +++ b/fs/fs_parser.c @@ -156,6 +156,7 @@ int fs_lookup_param(struct fs_context *fc, f = getname_kernel(param->string); if (IS_ERR(f)) return PTR_ERR(f); + param->dirfd = AT_FDCWD; put_f = true; break; case fs_value_is_filename: |