Skip to contentSkip to conversation

Backport several fuse patches for 6.1.y

PATCH New Yang Bo 1 participant 2 messages Apr 19, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Bo

author
#0 lore raw

cover Backport several fuse patches for 6.1.y

Antgroup is using 5.10.y in product environment, we found several patches are missing in 5.10.y tree. These patches are needed for us. So we backported them to 5.10.y. Also backport to 5.15.y and 6.1.y to prevent regression.

Jiachen Zhang (1):
fuse: always revalidate rename target dentry

 fs/fuse/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.40.0
author
#1 lore raw

PATCH 1/1 fuse: always revalidate rename target dentry

From: Jiachen Zhang <[email protected]>

commit ccc031e26afe60d2a5a3d93dabd9c978210825fb upstream.

[backport for 6.1.y]

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.

---
 fs/fuse/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dir.c +1 -1
index bb97a384dc5d..904673a4f690 100644
@@ -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;
Signature · 1 line
2.40.0