Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 5.10/5.15 1/3] fuse: move fuse_invalidate_attr() into fuse_update_ctime()
@ 2025-06-24  8:35 Dmitriy Privalov
  2025-06-24  8:35 ` [PATCH v2 5.10/5.15 2/3] fuse: decrement nlink on overwriting rename Dmitriy Privalov
  2025-06-24  8:35 ` [PATCH v2 5.10/5.15 3/3] fuse: don't increment nlink in link() Dmitriy Privalov
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitriy Privalov @ 2025-06-24  8:35 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman
  Cc: Dmitriy Privalov, Miklos Szeredi, linux-fsdevel, linux-kernel,
	lvc-project, Miklos Szeredi

From: Miklos Szeredi <mszeredi@redhat.com>

commit 371e8fd02969383204b1f6023451125dbc20dfbd upstream.

Logically it belongs there since attributes are invalidated due to the
updated ctime.  This is a cleanup and should not change behavior.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Dmitriy Privalov <d.privalov@omp.ru>
---
v2: Add 371e8fd02969 and cefd1b83275d to backport

 fs/fuse/dir.c   |  9 ++-------
 fs/fuse/xattr.c | 10 ++++------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 4488a53a192d..38c3bc68d080 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -809,6 +809,7 @@ void fuse_flush_time_update(struct inode *inode)
 
 void fuse_update_ctime(struct inode *inode)
 {
+	fuse_invalidate_attr(inode);
 	if (!IS_NOCMTIME(inode)) {
 		inode->i_ctime = current_time(inode);
 		mark_inode_dirty_sync(inode);
@@ -846,7 +847,6 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
 		if (inode->i_nlink > 0)
 			drop_nlink(inode);
 		spin_unlock(&fi->lock);
-		fuse_invalidate_attr(inode);
 		fuse_dir_changed(dir);
 		fuse_invalidate_entry_cache(entry);
 		fuse_update_ctime(inode);
@@ -903,13 +903,10 @@ static int fuse_rename_common(struct inode *olddir, struct dentry *oldent,
 	err = fuse_simple_request(fm, &args);
 	if (!err) {
 		/* ctime changes */
-		fuse_invalidate_attr(d_inode(oldent));
 		fuse_update_ctime(d_inode(oldent));
 
-		if (flags & RENAME_EXCHANGE) {
-			fuse_invalidate_attr(d_inode(newent));
+		if (flags & RENAME_EXCHANGE)
 			fuse_update_ctime(d_inode(newent));
-		}
 
 		fuse_dir_changed(olddir);
 		if (olddir != newdir)
@@ -917,7 +914,6 @@ static int fuse_rename_common(struct inode *olddir, struct dentry *oldent,
 
 		/* newent will end up negative */
 		if (!(flags & RENAME_EXCHANGE) && d_really_is_positive(newent)) {
-			fuse_invalidate_attr(d_inode(newent));
 			fuse_invalidate_entry_cache(newent);
 			fuse_update_ctime(d_inode(newent));
 		}
@@ -1000,7 +996,6 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
 		if (likely(inode->i_nlink < UINT_MAX))
 			inc_nlink(inode);
 		spin_unlock(&fi->lock);
-		fuse_invalidate_attr(inode);
 		fuse_update_ctime(inode);
 	} else if (err == -EINTR) {
 		fuse_invalidate_attr(inode);
diff --git a/fs/fuse/xattr.c b/fs/fuse/xattr.c
index 314e460ce679..27d7ea5e4176 100644
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c
@@ -39,10 +39,9 @@ int fuse_setxattr(struct inode *inode, const char *name, const void *value,
 		fm->fc->no_setxattr = 1;
 		err = -EOPNOTSUPP;
 	}
-	if (!err) {
-		fuse_invalidate_attr(inode);
+	if (!err)
 		fuse_update_ctime(inode);
-	}
+
 	return err;
 }
 
@@ -170,10 +169,9 @@ int fuse_removexattr(struct inode *inode, const char *name)
 		fm->fc->no_removexattr = 1;
 		err = -EOPNOTSUPP;
 	}
-	if (!err) {
-		fuse_invalidate_attr(inode);
+	if (!err)
 		fuse_update_ctime(inode);
-	}
+
 	return err;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-24  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24  8:35 [PATCH v2 5.10/5.15 1/3] fuse: move fuse_invalidate_attr() into fuse_update_ctime() Dmitriy Privalov
2025-06-24  8:35 ` [PATCH v2 5.10/5.15 2/3] fuse: decrement nlink on overwriting rename Dmitriy Privalov
2025-06-24  8:35 ` [PATCH v2 5.10/5.15 3/3] fuse: don't increment nlink in link() Dmitriy Privalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox