Skip to content

Commit

Permalink
Rename acltype=posixacl to acltype=posix
Browse files Browse the repository at this point in the history
Prefer acltype=off|posix, retaining the old names as aliases.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
  • Loading branch information
Ryan Moeller authored and Ryan Moeller committed Sep 11, 2020
1 parent 8e7fe49 commit c2c1426
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 35 deletions.
2 changes: 1 addition & 1 deletion include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C" {
* Property values for acltype
*/
#define ZFS_ACLTYPE_OFF 0
#define ZFS_ACLTYPE_POSIXACL 1
#define ZFS_ACLTYPE_POSIX 1

/*
* Field manipulation macros for the drr_versioninfo field of the
Expand Down
9 changes: 6 additions & 3 deletions man/man8/zfsprops.8
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ you must first remove all
.Tn ACL
entries which do not represent the current mode.
.El
.It Sy acltype Ns = Ns Sy off Ns | Ns Sy noacl Ns | Ns Sy posixacl
.It Sy acltype Ns = Ns Sy off Ns | Ns Sy posix
Controls whether ACLs are enabled and if so what type of ACL to use.
This property is not visible on FreeBSD yet.
.Bl -tag -width "posixacl"
Expand All @@ -662,15 +662,18 @@ property set to off then ACLs are disabled.
.It Sy noacl
an alias for
.Sy off
.It Sy posixacl
.It Sy posix
indicates POSIX ACLs should be used. POSIX ACLs are specific to Linux and are
not functional on other platforms. POSIX ACLs are stored as an extended
attribute and therefore will not overwrite any existing NFSv4 ACLs which
may be set.
.It Sy posixacl
an alias for
.Sy posix
.El
.Pp
To obtain the best performance when setting
.Sy posixacl
.Sy posix
users are strongly encouraged to set the
.Sy xattr=sa
property. This will result in the POSIX ACL being stored more efficiently on
Expand Down
2 changes: 1 addition & 1 deletion module/os/linux/zfs/zfs_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ zfs_acl_chown_setattr(znode_t *zp)
int error;
zfs_acl_t *aclp;

if (ZTOZSB(zp)->z_acl_type == ZFS_ACLTYPE_POSIXACL)
if (ZTOZSB(zp)->z_acl_type == ZFS_ACLTYPE_POSIX)
return (0);

ASSERT(MUTEX_HELD(&zp->z_lock));
Expand Down
4 changes: 2 additions & 2 deletions module/os/linux/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ acltype_changed_cb(void *arg, uint64_t newval)
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;
zfsvfs->z_sb->s_flags &= ~SB_POSIXACL;
break;
case ZFS_ACLTYPE_POSIXACL:
case ZFS_ACLTYPE_POSIX:
#ifdef CONFIG_FS_POSIX_ACL
zfsvfs->z_acl_type = ZFS_ACLTYPE_POSIXACL;
zfsvfs->z_acl_type = ZFS_ACLTYPE_POSIX;
zfsvfs->z_sb->s_flags |= SB_POSIXACL;
#else
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;
Expand Down
2 changes: 1 addition & 1 deletion module/os/linux/zfs/zpl_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ __zpl_show_options(struct seq_file *seq, zfsvfs_t *zfsvfs)

#ifdef CONFIG_FS_POSIX_ACL
switch (zfsvfs->z_acl_type) {
case ZFS_ACLTYPE_POSIXACL:
case ZFS_ACLTYPE_POSIX:
seq_puts(seq, ",posixacl");
break;
default:
Expand Down
16 changes: 8 additions & 8 deletions module/os/linux/zfs/zpl_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
struct posix_acl *acl = NULL;
int error = 0;

if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0);

if (!S_ISLNK(ip->i_mode)) {
Expand Down Expand Up @@ -1103,7 +1103,7 @@ zpl_chmod_acl(struct inode *ip)
struct posix_acl *acl;
int error;

if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0);

if (S_ISLNK(ip->i_mode))
Expand All @@ -1129,7 +1129,7 @@ __zpl_xattr_acl_list_access(struct inode *ip, char *list, size_t list_size,
char *xattr_name = XATTR_NAME_POSIX_ACL_ACCESS;
size_t xattr_size = sizeof (XATTR_NAME_POSIX_ACL_ACCESS);

if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0);

if (list && xattr_size <= list_size)
Expand All @@ -1146,7 +1146,7 @@ __zpl_xattr_acl_list_default(struct inode *ip, char *list, size_t list_size,
char *xattr_name = XATTR_NAME_POSIX_ACL_DEFAULT;
size_t xattr_size = sizeof (XATTR_NAME_POSIX_ACL_DEFAULT);

if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0);

if (list && xattr_size <= list_size)
Expand All @@ -1168,7 +1168,7 @@ __zpl_xattr_acl_get_access(struct inode *ip, const char *name,
if (strcmp(name, "") != 0)
return (-EINVAL);
#endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP);

acl = zpl_get_acl(ip, type);
Expand Down Expand Up @@ -1196,7 +1196,7 @@ __zpl_xattr_acl_get_default(struct inode *ip, const char *name,
if (strcmp(name, "") != 0)
return (-EINVAL);
#endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP);

acl = zpl_get_acl(ip, type);
Expand Down Expand Up @@ -1224,7 +1224,7 @@ __zpl_xattr_acl_set_access(struct inode *ip, const char *name,
if (strcmp(name, "") != 0)
return (-EINVAL);
#endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP);

if (!inode_owner_or_capable(ip))
Expand Down Expand Up @@ -1264,7 +1264,7 @@ __zpl_xattr_acl_set_default(struct inode *ip, const char *name,
if (strcmp(name, "") != 0)
return (-EINVAL);
#endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL)
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP);

if (!inode_owner_or_capable(ip))
Expand Down
11 changes: 6 additions & 5 deletions module/zcommon/zfs_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ zfs_prop_init(void)

static zprop_index_t acltype_table[] = {
{ "off", ZFS_ACLTYPE_OFF },
{ "disabled", ZFS_ACLTYPE_OFF },
{ "noacl", ZFS_ACLTYPE_OFF },
{ "posixacl", ZFS_ACLTYPE_POSIXACL },
{ "disabled", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
{ "noacl", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
{ "posixacl", ZFS_ACLTYPE_POSIX }, /* bkwrd compatibility */
{ "posix", ZFS_ACLTYPE_POSIX },
{ NULL }
};

Expand Down Expand Up @@ -430,7 +431,7 @@ zfs_prop_init(void)
#ifndef __FreeBSD__
zprop_register_index(ZFS_PROP_ACLTYPE, "acltype", ZFS_ACLTYPE_OFF,
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
"noacl | posixacl", "ACLTYPE", acltype_table);
"off | posix", "ACLTYPE", acltype_table);
#endif
zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
Expand Down Expand Up @@ -705,7 +706,7 @@ zfs_prop_init(void)
zprop_register_impl(ZFS_PROP_ACLTYPE, "acltype", PROP_TYPE_INDEX,
ZFS_ACLTYPE_OFF, NULL, PROP_INHERIT,
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
"noacl | posixacl", "ACLTYPE", B_FALSE, B_FALSE, acltype_table);
"off | posix", "ACLTYPE", B_FALSE, B_FALSE, acltype_table);
#endif
zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER,
PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG");
Expand Down
4 changes: 2 additions & 2 deletions tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#
# DESCRIPTION:
# Verify that user can access file/directory if acltype=posixacl.
# Verify that user can access file/directory if acltype=posix.
#
# STRATEGY:
# 1. Test access to file (mode=rw-)
Expand All @@ -50,7 +50,7 @@ function cleanup
rmdir $TESTDIR/dir.0
}

log_assert "Verify acltype=posixacl works on file"
log_assert "Verify acltype=posix works on file"
log_onexit cleanup

# Test access to FILE
Expand Down
4 changes: 2 additions & 2 deletions tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#
# DESCRIPTION:
# Verify that user can access file/directory if acltype=posixacl.
# Verify that user can access file/directory if acltype=posix.
#
# STRATEGY:
# 1. Test access to directory (mode=-wx)
Expand All @@ -43,7 +43,7 @@
#

verify_runnable "both"
log_assert "Verify acltype=posixacl works on directory"
log_assert "Verify acltype=posix works on directory"

# Test access to DIRECTORY
log_note "Testing access to DIRECTORY"
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/acl/posix/setup.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ default_setup_noexit $DISK
log_must chmod 777 $TESTDIR

# Use POSIX ACLs on filesystem
log_must zfs set acltype=posixacl $TESTPOOL/$TESTFS
log_must zfs set acltype=posix $TESTPOOL/$TESTFS
log_must zfs set xattr=sa $TESTPOOL/$TESTFS

log_pass
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ set -A RW_FS_PROP "quota=536870912" \
"setuid=off" \
"readonly=on" \
"snapdir=visible" \
"acltype=posixacl" \
"acltype=posix" \
"aclinherit=discard" \
"canmount=off"
if is_freebsd; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ set -A RW_FS_PROP "quota=536870912" \
"setuid=off" \
"readonly=on" \
"snapdir=visible" \
"acltype=posixacl" \
"acltype=posix" \
"aclinherit=discard" \
"canmount=off"

Expand Down
8 changes: 4 additions & 4 deletions tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ if is_linux; then
# zfs get/set subcommands - ordered as per the list above so we
# can iterate over both sets in an array
PROP_VALS="\
posixacl on \
posix on \
fletcher2 on on \
on legacy none on \
128K none on \
visible"

# these are an alternate set of property values
PROP_ALTVALS="\
noacl off \
off off \
fletcher4 lzjb off \
off /tmp/zfstest 100M off \
512 10m off \
Expand All @@ -66,15 +66,15 @@ elif is_freebsd; then
# zfs get/set subcommands - ordered as per the list above so we
# can iterate over both sets in an array
PROP_VALS="\
posixacl on \
posix on \
fletcher2 on on \
on legacy none on \
128K none on \
visible"

# these are an alternate set of property values
PROP_ALTVALS="\
noacl off \
off off \
fletcher4 lzjb off \
off /tmp/zfstest 100M off \
512 10m off \
Expand Down
4 changes: 2 additions & 2 deletions tests/zfs-tests/tests/functional/history/history_002_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ props=(
mountpoint /history.$$ mountpoint legacy
mountpoint none compression lz4
compression on compression off
compression lzjb acltype noacl
acltype posixacl xattr sa
compression lzjb acltype off
acltype posix xattr sa
atime on atime off
devices on devices off
exec on exec off
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for fs in "$POOL" "$POOL/pclone" "$POOL/$FS" "$POOL/$FS/fs1" \
"$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
rand_set_prop $fs acltype "off" "noacl" "posixacl"
rand_set_prop $fs acltype "off" "posix" "noacl" "posixacl"
rand_set_prop $fs atime "on" "off"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
rand_set_prop $fs compression "${compress_prop_vals[@]}"
Expand Down

0 comments on commit c2c1426

Please sign in to comment.