Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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().

Fixes: 461c3af045d3 ("ext4: Change handle_mount_opt() to use fs_parameter")
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20221004135803.32283-1-lczerner@redhat.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org

authored by

Lukas Czerner and committed by
Theodore Ts'o
e3ea75ee 56d0d0b9

+5 -2
+1
Documentation/filesystems/mount_api.rst
··· 814 814 int fs_lookup_param(struct fs_context *fc, 815 815 struct fs_parameter *value, 816 816 bool want_bdev, 817 + unsigned int flags, 817 818 struct path *_path); 818 819 819 820 This takes a parameter that carries a string or filename type and attempts
+1 -1
fs/ext4/super.c
··· 2247 2247 return -EINVAL; 2248 2248 } 2249 2249 2250 - error = fs_lookup_param(fc, param, 1, &path); 2250 + error = fs_lookup_param(fc, param, 1, LOOKUP_FOLLOW, &path); 2251 2251 if (error) { 2252 2252 ext4_msg(NULL, KERN_ERR, "error: could not find " 2253 2253 "journal device path");
+2 -1
fs/fs_parser.c
··· 138 138 * @fc: The filesystem context to log errors through. 139 139 * @param: The parameter. 140 140 * @want_bdev: T if want a blockdev 141 + * @flags: Pathwalk flags passed to filename_lookup() 141 142 * @_path: The result of the lookup 142 143 */ 143 144 int fs_lookup_param(struct fs_context *fc, 144 145 struct fs_parameter *param, 145 146 bool want_bdev, 147 + unsigned int flags, 146 148 struct path *_path) 147 149 { 148 150 struct filename *f; 149 - unsigned int flags = 0; 150 151 bool put_f; 151 152 int ret; 152 153
+1
include/linux/fs_parser.h
··· 76 76 extern int fs_lookup_param(struct fs_context *fc, 77 77 struct fs_parameter *param, 78 78 bool want_bdev, 79 + unsigned int flags, 79 80 struct path *_path); 80 81 81 82 extern int lookup_constant(const struct constant_table tbl[], const char *name, int not_found);