From 1003ae1cc928727b7eb49dd7c6be8444f424f33f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 15 Dec 2022 10:47:08 +0100 Subject: [PATCH] 5.10-stable patches added patches: fuse-always-revalidate-if-exclusive-create.patch --- ...lways-revalidate-if-exclusive-create.patch | 34 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 queue-5.10/fuse-always-revalidate-if-exclusive-create.patch diff --git a/queue-5.10/fuse-always-revalidate-if-exclusive-create.patch b/queue-5.10/fuse-always-revalidate-if-exclusive-create.patch new file mode 100644 index 00000000000..d0a033a7ba3 --- /dev/null +++ b/queue-5.10/fuse-always-revalidate-if-exclusive-create.patch @@ -0,0 +1,34 @@ +From df8629af293493757beccac2d3168fe5a315636e Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Wed, 11 Nov 2020 17:22:32 +0100 +Subject: fuse: always revalidate if exclusive create + +From: Miklos Szeredi + +commit df8629af293493757beccac2d3168fe5a315636e upstream. + +Failure to do so may result in EEXIST even if the file only exists in the +cache and not in the filesystem. + +The atomic nature of O_EXCL mandates that the cached state should be +ignored and existence verified anew. + +Reported-by: Ken Schalk +Signed-off-by: Miklos Szeredi +Signed-off-by: Wu Bo +Signed-off-by: Greg Kroah-Hartman +--- + fs/fuse/dir.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/fuse/dir.c ++++ b/fs/fuse/dir.c +@@ -205,7 +205,7 @@ static int fuse_dentry_revalidate(struct + if (inode && fuse_is_bad(inode)) + goto invalid; + else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) || +- (flags & LOOKUP_REVAL)) { ++ (flags & (LOOKUP_EXCL | LOOKUP_REVAL))) { + struct fuse_entry_out outarg; + FUSE_ARGS(args); + struct fuse_forget_link *forget; diff --git a/queue-5.10/series b/queue-5.10/series index 18d71b95e42..fdf16de22e5 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -2,3 +2,4 @@ x86-smpboot-move-rcu_cpu_starting-earlier.patch vfs-fix-copy_file_range-regression-in-cross-fs-copies.patch vfs-fix-copy_file_range-averts-filesystem-freeze-protection.patch nfp-fix-use-after-free-in-area_cache_get.patch +fuse-always-revalidate-if-exclusive-create.patch -- 2.47.3