]> Git Repo - J-linux.git/commitdiff
fuse: respect FOPEN_KEEP_CACHE on opendir
authorAmir Goldstein <[email protected]>
Wed, 1 Jan 2025 13:00:37 +0000 (14:00 +0100)
committerChristian Brauner <[email protected]>
Sat, 4 Jan 2025 08:58:14 +0000 (09:58 +0100)
The re-factoring of fuse_dir_open() missed the need to invalidate
directory inode page cache with open flag FOPEN_KEEP_CACHE.

Fixes: 7de64d521bf92 ("fuse: break up fuse_open_common()")
Reported-by: Prince Kumar <[email protected]>
Closes: https://lore.kernel.org/linux-fsdevel/CAEW=TRr7CYb4LtsvQPLj-zx5Y+EYBmGfM24SuzwyDoGVNoKm7w@mail.gmail.com/
Signed-off-by: Amir Goldstein <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bernd Schubert <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
fs/fuse/dir.c

index 494ac372ace07ab4ea06c13a404ecc1d2ccb4f23..e540d05549fff8bbe0977e909ecfa7149655fe66 100644 (file)
@@ -1681,6 +1681,8 @@ static int fuse_dir_open(struct inode *inode, struct file *file)
                 */
                if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE))
                        nonseekable_open(inode, file);
+               if (!(ff->open_flags & FOPEN_KEEP_CACHE))
+                       invalidate_inode_pages2(inode->i_mapping);
        }
 
        return err;
This page took 0.051359 seconds and 4 git commands to generate.