summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorJiachen Zhang <zhangjiachen.jaycee@bytedance.com>2022-09-28 20:19:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-26 13:51:54 +0200
commite21d9c60683915b483dee47e10aba285d03f2ff3 (patch)
treec3b23cfa5f7a2a961b4d854b744d72d8165597f2 /fs/fuse
parentc10a5b34068156c2094f86796eb125a47be24c2f (diff)
downloadlinux-e21d9c60683915b483dee47e10aba285d03f2ff3.tar.gz
linux-e21d9c60683915b483dee47e10aba285d03f2ff3.tar.bz2
linux-e21d9c60683915b483dee47e10aba285d03f2ff3.zip
fuse: always revalidate rename target dentry
commit ccc031e26afe60d2a5a3d93dabd9c978210825fb upstream. The previous commit df8629af2934 ("fuse: always revalidate if exclusive create") ensures that the dentries are revalidated on O_EXCL creates. This commit complements it by also performing revalidation for rename target dentries. Otherwise, a rename target file that only exists in kernel dentry cache but not in the filesystem will result in EEXIST if RENAME_NOREPLACE flag is used. Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com> Signed-off-by: Zhang Tianci <zhangtianci.1997@bytedance.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Yang Bo <yb203166@antfin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 80a2181b402b..075266140fac 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -205,7 +205,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
if (inode && fuse_is_bad(inode))
goto invalid;
else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) ||
- (flags & (LOOKUP_EXCL | LOOKUP_REVAL))) {
+ (flags & (LOOKUP_EXCL | LOOKUP_REVAL | LOOKUP_RENAME_TARGET))) {
struct fuse_entry_out outarg;
FUSE_ARGS(args);
struct fuse_forget_link *forget;