diff options
author | Amir Goldstein <amir73il@gmail.com> | 2025-01-01 14:00:37 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-01-04 09:58:14 +0100 |
commit | 03f275adb8fbd7b4ebe96a1ad5044d8e602692dc (patch) | |
tree | bca40c65ca12280138649bcc20e7467c8dc47b90 /fs | |
parent | Merge patch series "netfs, ceph, nfs, cachefiles: Miscellaneous fixes/changes" (diff) | |
download | linux-03f275adb8fbd7b4ebe96a1ad5044d8e602692dc.tar.xz linux-03f275adb8fbd7b4ebe96a1ad5044d8e602692dc.zip |
fuse: respect FOPEN_KEEP_CACHE on opendir
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 <princer@google.com>
Closes: https://lore.kernel.org/linux-fsdevel/CAEW=TRr7CYb4LtsvQPLj-zx5Y+EYBmGfM24SuzwyDoGVNoKm7w@mail.gmail.com/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20250101130037.96680-1-amir73il@gmail.com
Reviewed-by: Bernd Schubert <bernd.schubert@fastmail.fm>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 494ac372ace0..e540d05549ff 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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; |