ext4: journal_path mount options should follow links
Subsystems (3)
PATCH 1/1 ext4: journal_path mount options should follow links
Before the commit 461c3af045d3 ("ext4: Change handle_mount_opt() to use fs_parameter") ext4 mount option journal_path did follow links in the provided path.
Bring this behavior back by allowing to pass pathwalk flags to fs_lookup_param().
--- Documentation/filesystems/mount_api.rst | 1 + fs/ext4/super.c | 2 +- fs/fs_parser.c | 3 ++- include/linux/fs_parser.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-)
Documentation/filesystems/mount_api.rst +1 -0
@@ -814,6 +814,7 @@ process the parameters it is given. int fs_lookup_param(struct fs_context *fc, struct fs_parameter *value, bool want_bdev, + unsigned int flags, struct path *_path); This takes a parameter that carries a string or filename type and attempts
fs/ext4/super.c +1 -1
@@ -2271,7 +2271,7 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)return -EINVAL ; } - error =fs_lookup_param (fc, param,1 , &path); + error =fs_lookup_param (fc, param,1 ,LOOKUP_FOLLOW , &path);if (error) {ext4_msg (NULL ,KERN_ERR ,"error: could not find " "journal device path" );
fs/fs_parser.c +2 -1
@@ -138,15 +138,16 @@ EXPORT_SYMBOL(__fs_parse);* @fc: The filesystem context to log errors through. * @param: The parameter. * @want_bdev: T if want a blockdev +* @flags: Pathwalk flags passed to filename_lookup() * @_path: The result of the lookup */ int fs_lookup_param (struct fs_context *fc,struct fs_parameter *param,bool want_bdev, +unsigned int flags,struct path *_path) {struct filename *f; -unsigned int flags =0 ;bool put_f;int ret;
include/linux/fs_parser.h +1 -0
@@ -76,6 +76,7 @@ static inline int fs_parse(struct fs_context *fc,extern int fs_lookup_param (struct fs_context *fc,struct fs_parameter *param,bool want_bdev, +unsigned int flags,struct path *_path);extern int lookup_constant (const struct constant_table tbl[],const char *name,int not_found);
Signature · 1 line
2.37.3
Quoted 9 lines · Lukas Czerner
Before the commit
461c3af045d3("ext4: Changehandle_mount_opt()to usefs_parameter") ext4 mount optionjournal_pathdid follow links in the provided path.Bring this behavior back by allowing to pass pathwalk flags to
fs_lookup_param().Fixes 461c3af045d3 ("ext4: Change handle_mount_opt() to use fs_parameter")Signed-off-by Lukas Czerner <[email protected]>
This bit me recently when I was debugging an old system that used an external journal on an LVM LV and I wanted to know if the bug I was chasing also reproduced on upstream. Thanks for fixing this before I got around to making a patch:
--D
Quoted 69 lines
--- Documentation/filesystems/mount_api.rst | 1 + fs/ext4/super.c | 2 +- fs/fs_parser.c | 3 ++- include/linux/fs_parser.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-)Documentation/filesystems/mount_api.rst +1
-0@@ -814,6 +814,7 @@ process the parameters it is given. int fs_lookup_param(struct fs_context *fc, struct fs_parameter *value, bool want_bdev, + unsigned int flags, struct path *_path); This takes a parameter that carries a string or filename type and attemptsfs/ext4/super.c +1
-1@@ -2271,7 +2271,7 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)return -EINVAL ; } - error =fs_lookup_param (fc, param,1 , &path); + error =fs_lookup_param (fc, param,1 ,LOOKUP_FOLLOW , &path);if (error) {ext4_msg (NULL ,KERN_ERR ,"error: could not find " "journal device path" );fs/fs_parser.c +2
-1@@ -138,15 +138,16 @@ EXPORT_SYMBOL(__fs_parse);* @fc: The filesystem context to log errors through. * @param: The parameter. * @want_bdev: T if want a blockdev +* @flags: Pathwalk flags passed to filename_lookup() * @_path: The result of the lookup */ int fs_lookup_param (struct fs_context *fc,struct fs_parameter *param,bool want_bdev, +unsigned int flags,struct path *_path) {struct filename *f; -unsigned int flags =0 ;bool put_f;int ret;include/linux/fs_parser.h +1
-0@@ -76,6 +76,7 @@ static inline int fs_parse(struct fs_context *fc,extern int fs_lookup_param (struct fs_context *fc,struct fs_parameter *param,bool want_bdev, +unsigned int flags,struct path *_path);extern int lookup_constant (const struct constant_table tbl[],const char *name,int not_found);Signature · 1 line
2.37.3
Quoted 8 lines · Lukas Czerner
Before the commit
461c3af045d3("ext4: Changehandle_mount_opt()to usefs_parameter") ext4 mount optionjournal_pathdid follow links in the provided path.Bring this behavior back by allowing to pass pathwalk flags to
fs_lookup_param().[...]
Applied, thanks!
[1/1] ext4: journal_path mount options should follow links
commit: c5d6c14eac604c4ef551e2751726f665b3f09e32
Best regards,
Signature · 1 line
Theodore Ts'o <[email protected]>