diff options
author | Jiachen Zhang <zhangjiachen.jaycee@bytedance.com> | 2022-09-28 20:19:34 +0800 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2022-11-23 09:10:49 +0100 |
commit | ccc031e26afe60d2a5a3d93dabd9c978210825fb (patch) | |
tree | 6f4d443eace9e45118db8af327f93e8e6c917509 | |
parent | 4f8d37020e1fd0bf6ee9381ba918135ef3712efd (diff) | |
download | linux-stable-ccc031e26afe60d2a5a3d93dabd9c978210825fb.tar.gz linux-stable-ccc031e26afe60d2a5a3d93dabd9c978210825fb.tar.bz2 linux-stable-ccc031e26afe60d2a5a3d93dabd9c978210825fb.zip |
fuse: always revalidate rename target dentry
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>
-rw-r--r-- | fs/fuse/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d092c7d75929..2c4b08a6ec81 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -214,7 +214,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; |