]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
fuse2fs: don't update atime when reading executable file content
authorDarrick J. Wong <djwong@kernel.org>
Fri, 5 Sep 2025 20:52:24 +0000 (13:52 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 17 Oct 2025 23:34:22 +0000 (16:34 -0700)
The kernel doesn't update the atime of program files when it's paging
their content into memory, so fuse2fs shouldn't either.  Found by
generic/120.

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>
misc/fuse2fs.c

index 0f655c41372cc753ece1ae88772005512ed15a07..0ecdd4f9e93225f077335fae1ab5a3a2f783736b 100644 (file)
@@ -207,6 +207,7 @@ struct fuse2fs_file_handle {
        unsigned long magic;
        ext2_ino_t ino;
        int open_flags;
+       int check_flags;
 };
 
 /* Main program context */
@@ -2672,6 +2673,7 @@ static int __op_open(struct fuse2fs *ff, const char *path,
                        ret = check_inum_access(ff, file->ino, X_OK);
                        if (ret)
                                goto out;
+                       check = X_OK;
                } else
                        goto out;
        }
@@ -2682,6 +2684,7 @@ static int __op_open(struct fuse2fs *ff, const char *path,
                        goto out;
        }
 
+       file->check_flags = check;
        fp->fh = (uintptr_t)file;
 
 out:
@@ -2750,7 +2753,7 @@ out2:
                goto out;
        }
 
-       if (fs_writeable(fs)) {
+       if (fh->check_flags != X_OK && fs_writeable(fs)) {
                ret = update_atime(fs, fh->ino);
                if (ret)
                        goto out;