Whamcloud - gitweb
fuse2fs: allow some control over acls
authorDarrick J. Wong <djwong@kernel.org>
Wed, 21 May 2025 22:37:31 +0000 (15:37 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 May 2025 13:36:19 +0000 (09:36 -0400)
Allow some control over whether or not ACLs get used, though for kernel
mode it will always be enabled.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677729.1383760.10883670792875770541.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fuse2fs.c

index 2d4ea61..77d8321 100644 (file)
@@ -164,6 +164,7 @@ struct fuse2fs {
        uint8_t norecovery;
        uint8_t kernel;
        uint8_t directio;
+       uint8_t acl;
        unsigned long offset;
        unsigned int next_generation;
        unsigned long long cache_size;
@@ -652,6 +653,10 @@ static void *op_init(struct fuse_conn_info *conn
 #ifdef FUSE_CAP_IOCTL_DIR
        conn->want |= FUSE_CAP_IOCTL_DIR;
 #endif
+#ifdef FUSE_CAP_POSIX_ACL
+       if (ff->acl)
+               conn->want |= FUSE_CAP_POSIX_ACL;
+#endif
 #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
        conn->time_gran = 1;
        cfg->use_ino = 1;
@@ -3828,8 +3833,9 @@ static struct fuse_opt fuse2fs_opts[] = {
        FUSE2FS_OPT("offset=%lu",       offset,                 0),
        FUSE2FS_OPT("kernel",           kernel,                 1),
        FUSE2FS_OPT("directio",         directio,               1),
+       FUSE2FS_OPT("acl",              acl,                    1),
+       FUSE2FS_OPT("noacl",            acl,                    0),
 
-       FUSE_OPT_KEY("acl",             FUSE2FS_IGNORED),
        FUSE_OPT_KEY("user_xattr",      FUSE2FS_IGNORED),
        FUSE_OPT_KEY("noblock_validity", FUSE2FS_IGNORED),
        FUSE_OPT_KEY("cache_size=%s",   FUSE2FS_CACHE_SIZE),