Rename acltype=posixacl to acltype=posix

Prefer acltype=off|posix, retaining the old names as aliases.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10918
This commit is contained in:
Ryan Moeller 2020-09-16 15:26:06 -04:00 committed by Brian Behlendorf
parent 0968d689a2
commit 2cec08a1f0
15 changed files with 39 additions and 35 deletions

View File

@ -67,7 +67,7 @@ extern "C" {
* Property values for acltype * Property values for acltype
*/ */
#define ZFS_ACLTYPE_OFF 0 #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 * Field manipulation macros for the drr_versioninfo field of the

View File

@ -651,7 +651,7 @@ you must first remove all
.Tn ACL .Tn ACL
entries which do not represent the current mode. entries which do not represent the current mode.
.El .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. Controls whether ACLs are enabled and if so what type of ACL to use.
This property is not visible on FreeBSD yet. This property is not visible on FreeBSD yet.
.Bl -tag -width "posixacl" .Bl -tag -width "posixacl"
@ -662,15 +662,18 @@ property set to off then ACLs are disabled.
.It Sy noacl .It Sy noacl
an alias for an alias for
.Sy off .Sy off
.It Sy posixacl .It Sy posix
indicates POSIX ACLs should be used. POSIX ACLs are specific to Linux and are 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 not functional on other platforms. POSIX ACLs are stored as an extended
attribute and therefore will not overwrite any existing NFSv4 ACLs which attribute and therefore will not overwrite any existing NFSv4 ACLs which
may be set. may be set.
.It Sy posixacl
an alias for
.Sy posix
.El .El
.Pp .Pp
To obtain the best performance when setting To obtain the best performance when setting
.Sy posixacl .Sy posix
users are strongly encouraged to set the users are strongly encouraged to set the
.Sy xattr=sa .Sy xattr=sa
property. This will result in the POSIX ACL being stored more efficiently on property. This will result in the POSIX ACL being stored more efficiently on

View File

@ -1153,7 +1153,7 @@ zfs_acl_chown_setattr(znode_t *zp)
int error; int error;
zfs_acl_t *aclp; zfs_acl_t *aclp;
if (ZTOZSB(zp)->z_acl_type == ZFS_ACLTYPE_POSIXACL) if (ZTOZSB(zp)->z_acl_type == ZFS_ACLTYPE_POSIX)
return (0); return (0);
ASSERT(MUTEX_HELD(&zp->z_lock)); ASSERT(MUTEX_HELD(&zp->z_lock));

View File

@ -356,9 +356,9 @@ acltype_changed_cb(void *arg, uint64_t newval)
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF; zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;
zfsvfs->z_sb->s_flags &= ~SB_POSIXACL; zfsvfs->z_sb->s_flags &= ~SB_POSIXACL;
break; break;
case ZFS_ACLTYPE_POSIXACL: case ZFS_ACLTYPE_POSIX:
#ifdef CONFIG_FS_POSIX_ACL #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; zfsvfs->z_sb->s_flags |= SB_POSIXACL;
#else #else
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF; zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;

View File

@ -211,7 +211,7 @@ __zpl_show_options(struct seq_file *seq, zfsvfs_t *zfsvfs)
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
switch (zfsvfs->z_acl_type) { switch (zfsvfs->z_acl_type) {
case ZFS_ACLTYPE_POSIXACL: case ZFS_ACLTYPE_POSIX:
seq_puts(seq, ",posixacl"); seq_puts(seq, ",posixacl");
break; break;
default: default:

View File

@ -1058,7 +1058,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
struct posix_acl *acl = NULL; struct posix_acl *acl = NULL;
int error = 0; int error = 0;
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0); return (0);
if (!S_ISLNK(ip->i_mode)) { if (!S_ISLNK(ip->i_mode)) {
@ -1103,7 +1103,7 @@ zpl_chmod_acl(struct inode *ip)
struct posix_acl *acl; struct posix_acl *acl;
int error; int error;
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (0); return (0);
if (S_ISLNK(ip->i_mode)) if (S_ISLNK(ip->i_mode))
@ -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; char *xattr_name = XATTR_NAME_POSIX_ACL_ACCESS;
size_t xattr_size = sizeof (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); return (0);
if (list && xattr_size <= list_size) if (list && xattr_size <= list_size)
@ -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; char *xattr_name = XATTR_NAME_POSIX_ACL_DEFAULT;
size_t xattr_size = sizeof (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); return (0);
if (list && xattr_size <= list_size) if (list && xattr_size <= list_size)
@ -1168,7 +1168,7 @@ __zpl_xattr_acl_get_access(struct inode *ip, const char *name,
if (strcmp(name, "") != 0) if (strcmp(name, "") != 0)
return (-EINVAL); return (-EINVAL);
#endif #endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP); return (-EOPNOTSUPP);
acl = zpl_get_acl(ip, type); acl = zpl_get_acl(ip, type);
@ -1196,7 +1196,7 @@ __zpl_xattr_acl_get_default(struct inode *ip, const char *name,
if (strcmp(name, "") != 0) if (strcmp(name, "") != 0)
return (-EINVAL); return (-EINVAL);
#endif #endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP); return (-EOPNOTSUPP);
acl = zpl_get_acl(ip, type); acl = zpl_get_acl(ip, type);
@ -1224,7 +1224,7 @@ __zpl_xattr_acl_set_access(struct inode *ip, const char *name,
if (strcmp(name, "") != 0) if (strcmp(name, "") != 0)
return (-EINVAL); return (-EINVAL);
#endif #endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP); return (-EOPNOTSUPP);
if (!inode_owner_or_capable(ip)) if (!inode_owner_or_capable(ip))
@ -1264,7 +1264,7 @@ __zpl_xattr_acl_set_default(struct inode *ip, const char *name,
if (strcmp(name, "") != 0) if (strcmp(name, "") != 0)
return (-EINVAL); return (-EINVAL);
#endif #endif
if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIXACL) if (ITOZSB(ip)->z_acl_type != ZFS_ACLTYPE_POSIX)
return (-EOPNOTSUPP); return (-EOPNOTSUPP);
if (!inode_owner_or_capable(ip)) if (!inode_owner_or_capable(ip))

View File

@ -253,9 +253,10 @@ zfs_prop_init(void)
static zprop_index_t acltype_table[] = { static zprop_index_t acltype_table[] = {
{ "off", ZFS_ACLTYPE_OFF }, { "off", ZFS_ACLTYPE_OFF },
{ "disabled", ZFS_ACLTYPE_OFF }, { "posix", ZFS_ACLTYPE_POSIX },
{ "noacl", ZFS_ACLTYPE_OFF }, { "disabled", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
{ "posixacl", ZFS_ACLTYPE_POSIXACL }, { "noacl", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
{ "posixacl", ZFS_ACLTYPE_POSIX }, /* bkwrd compatibility */
{ NULL } { NULL }
}; };
@ -430,7 +431,7 @@ zfs_prop_init(void)
#ifndef __FreeBSD__ #ifndef __FreeBSD__
zprop_register_index(ZFS_PROP_ACLTYPE, "acltype", ZFS_ACLTYPE_OFF, zprop_register_index(ZFS_PROP_ACLTYPE, "acltype", ZFS_ACLTYPE_OFF,
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
"noacl | posixacl", "ACLTYPE", acltype_table); "off | posix", "ACLTYPE", acltype_table);
#endif #endif
zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
@ -705,7 +706,7 @@ zfs_prop_init(void)
zprop_register_impl(ZFS_PROP_ACLTYPE, "acltype", PROP_TYPE_INDEX, zprop_register_impl(ZFS_PROP_ACLTYPE, "acltype", PROP_TYPE_INDEX,
ZFS_ACLTYPE_OFF, NULL, PROP_INHERIT, ZFS_ACLTYPE_OFF, NULL, PROP_INHERIT,
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, 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 #endif
zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER, zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER,
PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG"); PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG");

View File

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

View File

@ -34,7 +34,7 @@
# #
# DESCRIPTION: # DESCRIPTION:
# Verify that user can access file/directory if acltype=posixacl. # Verify that user can access file/directory if acltype=posix.
# #
# STRATEGY: # STRATEGY:
# 1. Test access to directory (mode=-wx) # 1. Test access to directory (mode=-wx)
@ -43,7 +43,7 @@
# #
verify_runnable "both" verify_runnable "both"
log_assert "Verify acltype=posixacl works on directory" log_assert "Verify acltype=posix works on directory"
# Test access to DIRECTORY # Test access to DIRECTORY
log_note "Testing access to DIRECTORY" log_note "Testing access to DIRECTORY"

View File

@ -46,7 +46,7 @@ default_setup_noexit $DISK
log_must chmod 777 $TESTDIR log_must chmod 777 $TESTDIR
# Use POSIX ACLs on filesystem # 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_must zfs set xattr=sa $TESTPOOL/$TESTFS
log_pass log_pass

View File

@ -68,7 +68,7 @@ set -A RW_FS_PROP "quota=536870912" \
"setuid=off" \ "setuid=off" \
"readonly=on" \ "readonly=on" \
"snapdir=visible" \ "snapdir=visible" \
"acltype=posixacl" \ "acltype=posix" \
"aclinherit=discard" \ "aclinherit=discard" \
"canmount=off" "canmount=off"
if is_freebsd; then if is_freebsd; then

View File

@ -68,7 +68,7 @@ set -A RW_FS_PROP "quota=536870912" \
"setuid=off" \ "setuid=off" \
"readonly=on" \ "readonly=on" \
"snapdir=visible" \ "snapdir=visible" \
"acltype=posixacl" \ "acltype=posix" \
"aclinherit=discard" \ "aclinherit=discard" \
"canmount=off" "canmount=off"

View File

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

View File

@ -72,8 +72,8 @@ props=(
mountpoint /history.$$ mountpoint legacy mountpoint /history.$$ mountpoint legacy
mountpoint none compression lz4 mountpoint none compression lz4
compression on compression off compression on compression off
compression lzjb acltype noacl compression lzjb acltype off
acltype posixacl xattr sa acltype posix xattr sa
atime on atime off atime on atime off
devices on devices off devices on devices off
exec on exec off exec on exec off

View File

@ -116,7 +116,7 @@ for fs in "$POOL" "$POOL/pclone" "$POOL/$FS" "$POOL/$FS/fs1" \
"$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough" rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256" 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 atime "on" "off"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256" rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
rand_set_prop $fs compression "${compress_prop_vals[@]}" rand_set_prop $fs compression "${compress_prop_vals[@]}"