[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175797569763.245695.8285471672384752332.stgit@frogsfrogsfrogs>
Date: Mon, 15 Sep 2025 15:39:48 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: [PATCH 08/12] fuse2fs: fix default acls propagating to non-dir
children
From: Darrick J. Wong <djwong@...nel.org>
New non-directory children should not be copying the default ACLs of the
parents. Caught by generic/099 in fuseblk mode.
Cc: <linux-ext4@...r.kernel.org> # v1.47.3
Fixes: 2c7900387620a6 ("fuse2fs: propagate default ACLs to new children")
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index de675b4ecb9438..b5b860466742d2 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1167,13 +1167,13 @@ static int __setxattr(struct fuse2fs *ff, ext2_ino_t ino, const char *name,
}
static int propagate_default_acls(struct fuse2fs *ff, ext2_ino_t parent,
- ext2_ino_t child)
+ ext2_ino_t child, mode_t mode)
{
void *def;
size_t deflen;
int ret;
- if (!ff->acl)
+ if (!ff->acl || S_ISDIR(mode))
return 0;
ret = __getxattr(ff, parent, XATTR_NAME_POSIX_ACL_DEFAULT, &def,
@@ -1346,7 +1346,7 @@ static int op_mknod(const char *path, mode_t mode, dev_t dev)
ext2fs_inode_alloc_stats2(fs, child, 1, 0);
- ret = propagate_default_acls(ff, parent, child);
+ ret = propagate_default_acls(ff, parent, child, inode.i_mode);
if (ret)
goto out2;
out2:
@@ -1474,7 +1474,7 @@ static int op_mkdir(const char *path, mode_t mode)
goto out3;
}
- ret = propagate_default_acls(ff, parent, child);
+ ret = propagate_default_acls(ff, parent, child, inode.i_mode);
if (ret)
goto out3;
@@ -3543,7 +3543,7 @@ static int op_create(const char *path, mode_t mode, struct fuse_file_info *fp)
ext2fs_inode_alloc_stats2(fs, child, 1, 0);
- ret = propagate_default_acls(ff, parent, child);
+ ret = propagate_default_acls(ff, parent, child, inode.i_mode);
if (ret)
goto out2;
Powered by blists - more mailing lists