Unverified Commit 03f275ad authored by Amir Goldstein's avatar Amir Goldstein Committed by Christian Brauner
Browse files

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: 7de64d52 ("fuse: break up fuse_open_common()")
Reported-by: default avatarPrince Kumar <princer@google.com>
Closes: https://lore.kernel.org/linux-fsdevel/CAEW=TRr7CYb4LtsvQPLj-zx5Y+EYBmGfM24SuzwyDoGVNoKm7w@mail.gmail.com/


Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20250101130037.96680-1-amir73il@gmail.com


Reviewed-by: default avatarBernd Schubert <bernd.schubert@fastmail.fm>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 5fe85a5c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;