Skip to content

Commit 3d6a388

Browse files
shreeya-patel98PlaidCat
authored andcommitted
fuse: respect FOPEN_KEEP_CACHE on opendir
jira SECO-518 commit-author Amir Goldstein <amir73il@gmail.com> commit 03f275a The re-factoring of fuse_dir_open() missed the need to invalidate directory inode page cache with open flag FOPEN_KEEP_CACHE. Fixes: 7de64d5 ("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> (cherry picked from commit 03f275a) Signed-off-by: Shreeya Patel <spatel@ciq.com>
1 parent 992dd5c commit 3d6a388

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/fuse/dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,8 @@ static int fuse_dir_open(struct inode *inode, struct file *file)
16961696
*/
16971697
if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE))
16981698
nonseekable_open(inode, file);
1699+
if (!(ff->open_flags & FOPEN_KEEP_CACHE))
1700+
invalidate_inode_pages2(inode->i_mapping);
16991701
}
17001702

17011703
return err;

0 commit comments

Comments
 (0)