From 99eb466faca0d4fcbf442048a6ea24b97ef076dc Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: May 29 2023 16:14:14 +0000 Subject: Merge branch 'users/lhenriques/SLE15-SP4/for-next' into SLE15-SP4 Pull fuse fixes from Luís Henriques. --- diff --git a/patches.suse/fuse-always-revalidate-rename-target-dentry.patch b/patches.suse/fuse-always-revalidate-rename-target-dentry.patch new file mode 100644 index 0000000..abbdd13 --- /dev/null +++ b/patches.suse/fuse-always-revalidate-rename-target-dentry.patch @@ -0,0 +1,37 @@ +From: Jiachen Zhang +Date: Wed, 28 Sep 2022 20:19:34 +0800 +Subject: fuse: always revalidate rename target dentry +Git-commit: ccc031e26afe60d2a5a3d93dabd9c978210825fb +Patch-mainline: v6.2-rc1 +References: bsc#1211808 + +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 +Signed-off-by: Zhang Tianci +Signed-off-by: Miklos Szeredi +Acked-by: Luís Henriques + +--- + 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 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; + diff --git a/patches.suse/fuse-fix-attr-version-comparison-in-fuse_read_update_.patch b/patches.suse/fuse-fix-attr-version-comparison-in-fuse_read_update_.patch new file mode 100644 index 0000000..5517cda --- /dev/null +++ b/patches.suse/fuse-fix-attr-version-comparison-in-fuse_read_update_.patch @@ -0,0 +1,34 @@ +From: Miklos Szeredi +Date: Fri, 22 Oct 2021 17:03:03 +0200 +Subject: fuse: fix attr version comparison in fuse_read_update_size() +Git-commit: 484ce65715b06aead8c4901f01ca32c5a240bc71 +Patch-mainline: v5.16-rc1 +References: bsc#1211807 + +A READ request returning a short count is taken as indication of EOF, and +the cached file size is modified accordingly. + +Fix the attribute version checking to allow for changes to fc->attr_version +on other inodes. + +Signed-off-by: Miklos Szeredi +Acked-by: Luís Henriques + +--- + fs/fuse/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index c3fd88da2a0b..ddd563fda648 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -787,7 +787,7 @@ static void fuse_read_update_size(struct inode *inode, loff_t size, + struct fuse_inode *fi = get_fuse_inode(inode); + + spin_lock(&fi->lock); +- if (attr_ver == fi->attr_version && size < inode->i_size && ++ if (attr_ver >= fi->attr_version && size < inode->i_size && + !test_bit(FUSE_I_SIZE_UNSTABLE, &fi->state)) { + fi->attr_version = atomic64_inc_return(&fc->attr_version); + i_size_write(inode, size); + diff --git a/series.conf b/series.conf index 56dc5ff..29796ee 100644 --- a/series.conf +++ b/series.conf @@ -6950,6 +6950,7 @@ patches.suse/fs-orangefs-fix-error-return-code-of-orangefs_revali.patch patches.suse/fuse-make-sure-reclaim-doesn-t-write-the-inode.patch patches.suse/fuse-annotate-lock-in-fuse_reverse_inval_entry.patch + patches.suse/fuse-fix-attr-version-comparison-in-fuse_read_update_.patch patches.suse/virtiofs-use-strscpy-for-copying-the-queue-name.patch patches.suse/fuse-fix-page-stealing.patch patches.suse/ovl-fix-use-after-free-in-struct-ovl_aio_req.patch @@ -17735,6 +17736,7 @@ patches.suse/ext4-allocate-extended-attribute-value-in-vmalloc-ar.patch patches.suse/ext4-fix-inode-leak-in-ext4_xattr_inode_create-on-an.patch patches.suse/ext4-fix-reserved-cluster-accounting-in-__es_remove_.patch + patches.suse/fuse-always-revalidate-rename-target-dentry.patch patches.suse/NFSD-Finish-converting-the-NFSv2-GETACL-result-encod.patch patches.suse/NFSD-Finish-converting-the-NFSv3-GETACL-result-encod.patch patches.suse/nfsd-don-t-call-nfsd_file_put-from-client-states-seq.patch