* [PATCH] fuse: always revalidate rename target dentry
@ 2022-09-28 12:19 Jiachen Zhang
2022-10-12 13:50 ` Miklos Szeredi
0 siblings, 1 reply; 2+ messages in thread
From: Jiachen Zhang @ 2022-09-28 12:19 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-fsdevel, linux-kernel, Jiachen Zhang, Zhang Tianci
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 may result in an EEXIST.
Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
Signed-off-by: Zhang Tianci <zhangtianci.1997@bytedance.com>
---
fs/fuse/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index b585b04e815e..a453fc57ce4f 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;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fuse: always revalidate rename target dentry
2022-09-28 12:19 [PATCH] fuse: always revalidate rename target dentry Jiachen Zhang
@ 2022-10-12 13:50 ` Miklos Szeredi
0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2022-10-12 13:50 UTC (permalink / raw)
To: Jiachen Zhang; +Cc: linux-fsdevel, linux-kernel, Zhang Tianci
On Wed, 28 Sept 2022 at 14:20, Jiachen Zhang
<zhangjiachen.jaycee@bytedance.com> wrote:
>
> 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 may result in an EEXIST.
"...will result in EEXIST if RENAME_NOREPLACE flag is used."
Applied with the above change.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-12 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 12:19 [PATCH] fuse: always revalidate rename target dentry Jiachen Zhang
2022-10-12 13:50 ` Miklos Szeredi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).