[PATCHSET RFC v5 6/8] fuse: handle timestamps and ACLs correctly when iomap is enabled

Darrick J. Wong
2025-09-16T00:19:37Z

Hi all,

When iomap is enabled for a fuse file, we try to keep as much of the
file IO path in the kernel as we possibly can. That means no calling
out to the fuse server in the IO path when we can avoid it. However,
the existing FUSE architecture defers all file attributes to the fuse
server -- [cm]time updates, ACL metadata management, set[ug]id removal,
and permissions checking thereof, etc.

We'd really rather do all these attribute updates in the kernel, and
only push them to the fuse server when it's actually necessary (e.g.
fsync). Furthermore, the POSIX ACL code has the weird behavior that if
the access ACL can be represented entirely by i_mode bits, it will
change the mode and delete the ACL, which fuse servers generally don't
seem to implement.

IOWs, we want consistent and correct (as defined by fstests) behavior
of file attributes in iomap mode. Let's make the kernel manage all that
and push the results to userspace as needed. This improves performance
even further, since it's sort of like writeback_cache mode but more
aggressive.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=fuse-iomap-attrs
---
Commits in this patchset:
* fuse: enable caching of timestamps
* fuse: force a ctime update after a fileattr_set call when in iomap mode
* fuse: allow local filesystems to set some VFS iflags
* fuse_trace: allow local filesystems to set some VFS iflags
* fuse: cache atime when in iomap mode
* fuse: let the kernel handle KILL_SUID/KILL_SGID for iomap filesystems
* fuse_trace: let the kernel handle KILL_SUID/KILL_SGID for iomap filesystems
* fuse: update ctime when updating acls on an iomap inode
* fuse: always cache ACLs when using iomap
---
fs/fuse/fuse_i.h | 1 +
fs/fuse/fuse_trace.h | 87 +++++++++++++++++++++++++++++++++++++++++++++
include/uapi/linux/fuse.h | 8 ++++
fs/fuse/acl.c | 29 +++++++++++++--
fs/fuse/dir.c | 38 ++++++++++++++++----
fs/fuse/file.c | 18 ++++++---
fs/fuse/file_iomap.c | 6 +++
fs/fuse/inode.c | 27 +++++++++++---
fs/fuse/ioctl.c | 70 ++++++++++++++++++++++++++++++++++++
fs/fuse/readdir.c | 3 +-
10 files changed, 263 insertions(+), 24 deletions(-)