[PATCH 03/10] fuse2fs: let the kernel tell us about acl/mode updates

Darrick J. Wong
2025-09-16T01:04:14Z

When the kernel is running in iomap mode, it will also manage all the
ACL updates and the resulting file mode changes for us. Disable the
manual implementation of it in fuse2fs.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
fuse4fs/fuse4fs.c | 4 ++--
misc/fuse2fs.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 06be49164c783d..184066855517b1 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -2137,7 +2137,7 @@ static int fuse4fs_propagate_default_acls(struct fuse4fs *ff, ext2_ino_t parent,
size_t deflen;
int ret;

- if (!ff->acl || S_ISDIR(mode))
+ if (!ff->acl || S_ISDIR(mode) || fuse4fs_iomap_enabled(ff))
return 0;

ret = fuse4fs_getxattr(ff, parent, XATTR_NAME_POSIX_ACL_DEFAULT, &def,
@@ -3512,7 +3512,7 @@ static int fuse4fs_chmod(struct fuse4fs *ff, fuse_req_t req, ext2_ino_t ino,
* of the user's groups, but FUSE only tells us about the primary
* group.
*/
- if (!fuse4fs_is_superuser(ff, ctxt)) {
+ if (!fuse4fs_iomap_enabled(ff) && !fuse4fs_is_superuser(ff, ctxt)) {
ret = fuse4fs_in_file_group(ff, req, inode);
if (ret < 0)
return ret;
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 716793b5fa485c..2b3c09a59270bc 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1937,7 +1937,7 @@ static int propagate_default_acls(struct fuse2fs *ff, ext2_ino_t parent,
size_t deflen;
int ret;

- if (!ff->acl || S_ISDIR(mode))
+ if (!ff->acl || S_ISDIR(mode) || fuse2fs_iomap_enabled(ff))
return 0;

ret = __getxattr(ff, parent, XATTR_NAME_POSIX_ACL_DEFAULT, &def,
@@ -3213,7 +3213,7 @@ static int op_chmod(const char *path, mode_t mode, struct fuse_file_info *fi)
* of the user's groups, but FUSE only tells us about the primary
* group.
*/
- if (!is_superuser(ff, ctxt)) {
+ if (!fuse2fs_iomap_enabled(ff) && !is_superuser(ff, ctxt)) {
ret = in_file_group(ctxt, &inode);
if (ret < 0)
goto out;