]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ext4: journal_path mount options should follow links
authorLukas Czerner <lczerner@redhat.com>
Tue, 4 Oct 2022 13:58:03 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:16:02 +0000 (11:16 +0100)
commit e3ea75ee651daf5e434afbfdb7dbf75e200ea1f6 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/filesystems/mount_api.rst
fs/ext4/super.c
fs/fs_parser.c
include/linux/fs_parser.h

index eb358a00be2795359e07606e50c3f73864422341..1d16787a00e95af45acbeacba8648ab79d814a1a 100644 (file)
@@ -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
index 05635e7ab18b34559db61948c9ccc953fb82f3f5..4d7fa391cc3ac6b8905d11abe835aa08aa22c77d 100644 (file)
@@ -2260,7 +2260,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");
index ed40ce5742fda1bf69bae6c52791f339fc85138e..edb3712dcfa5805aa60364bd0c794c257ae04734 100644 (file)
@@ -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;
 
index f103c91139d4a7c6701b92c0fb4321f6a05d3dce..01542c4b87a2be065431f60c9f5d1302608a39a7 100644 (file)
@@ -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);