Whamcloud - gitweb
fuse2fs: flip parameter order in __translate_error
authorDarrick J. Wong <djwong@kernel.org>
Wed, 21 May 2025 22:37:00 +0000 (15:37 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 May 2025 13:36:19 +0000 (09:36 -0400)
Flip the parameter order in __translate_error so that it matches
translate_error.  I wasted too much time debugging a memory corruption
that happened because I converted translate_error to __translate_error
when developing the next patch and the compiler didn't warn me about
mismatched types.

Cc: linux-ext4@vger.kernel.org # v1.43
Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677693.1383760.5102016357729108965.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fuse2fs.c

index 2a4e77c..39f9f2d 100644 (file)
@@ -177,9 +177,9 @@ struct fuse2fs {
        return translate_error(global_fs, 0, EXT2_ET_BAD_MAGIC); \
 } while (0)
 
-static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino,
+static int __translate_error(ext2_filsys fs, ext2_ino_t ino, errcode_t err,
                             const char *file, int line);
-#define translate_error(fs, ino, err) __translate_error((fs), (err), (ino), \
+#define translate_error(fs, ino, err) __translate_error((fs), (ino), (err), \
                        __FILE__, __LINE__)
 
 /* for macosx */
@@ -4179,7 +4179,7 @@ out:
        return ret;
 }
 
-static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino,
+static int __translate_error(ext2_filsys fs, ext2_ino_t ino, errcode_t err,
                             const char *file, int line)
 {
        struct timespec now;