mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
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:
parent
9cc177baa0
commit
7ead2be3d2
@ -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
|
||||
|
@ -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"
|
||||
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -211,7 +211,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:
|
||||
|
@ -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)) {
|
||||
@ -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))
|
||||
@ -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)
|
||||
@ -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)
|
||||
@ -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);
|
||||
@ -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);
|
||||
@ -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))
|
||||
@ -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))
|
||||
|
@ -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 },
|
||||
{ "posix", ZFS_ACLTYPE_POSIX },
|
||||
{ "disabled", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
|
||||
{ "noacl", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
|
||||
{ "posixacl", ZFS_ACLTYPE_POSIX }, /* bkwrd compatibility */
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -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,
|
||||
@ -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");
|
||||
|
@ -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-)
|
||||
@ -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
|
||||
|
@ -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)
|
||||
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -41,7 +41,7 @@ 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 \
|
||||
@ -49,7 +49,7 @@ if is_linux; then
|
||||
|
||||
# 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 \
|
||||
@ -66,7 +66,7 @@ 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 \
|
||||
@ -74,7 +74,7 @@ elif is_freebsd; then
|
||||
|
||||
# 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 \
|
||||
|
@ -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
|
||||
|
@ -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[@]}"
|
||||
|
Loading…
Reference in New Issue
Block a user