[PATCH 8/9] fuse: update ctime when updating acls on an iomap inode

Darrick J. Wong
2025-09-16T00:38:08Z

In iomap mode, the fuse kernel driver is in charge of updating file
attributes, so we need to update ctime after an ACL change.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
fs/fuse/acl.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/acl.c b/fs/fuse/acl.c
index 4faee72f1365a5..9b24c53b510405 100644
--- a/fs/fuse/acl.c
+++ b/fs/fuse/acl.c
@@ -109,6 +109,7 @@ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
struct fuse_conn *fc = get_fuse_conn(inode);
const char *name;
umode_t mode = inode->i_mode;
+ const bool is_iomap = fuse_inode_has_iomap(inode);
int ret;

if (fuse_is_bad(inode))
@@ -179,10 +180,24 @@ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
ret = 0;
}

- /* If we scheduled a mode update above, push that to userspace now. */
if (!ret) {
struct iattr attr = { };

+ /*
+ * When we're running in iomap mode, we need to update mode and
+ * ctime ourselves instead of letting the fuse server figure
+ * that out.
+ */
+ if (is_iomap) {
+ attr.ia_valid |= ATTR_CTIME;
+ inode_set_ctime_current(inode);
+ attr.ia_ctime = inode_get_ctime(inode);
+ }
+
+ /*
+ * If we scheduled a mode update above, push that to userspace
+ * now.
+ */
if (mode != inode->i_mode) {
attr.ia_valid |= ATTR_MODE;
attr.ia_mode = mode;