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>

authored by Amir Goldstein and committed by Christian Brauner 03f275ad 5fe85a5c

Changed files
+2
fs
fuse
+2
fs/fuse/dir.c
··· 1681 1681 */ 1682 1682 if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE)) 1683 1683 nonseekable_open(inode, file); 1684 + if (!(ff->open_flags & FOPEN_KEEP_CACHE)) 1685 + invalidate_inode_pages2(inode->i_mapping); 1684 1686 } 1685 1687 1686 1688 return err;