diff options
author | Ryan Moeller <[email protected]> | 2020-10-14 00:25:48 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-13 21:25:48 -0700 |
commit | 485b50bb9e6772240af32fba434ddb8ebfa8cede (patch) | |
tree | 32c66cae383645c41bcf43ecc6345af532a1b5a7 /module/zcommon | |
parent | b302185a9283fa93ce98d17ca9893437753ec665 (diff) |
Cross-platform acltype
The acltype property is currently hidden on FreeBSD and does not
reflect the NFSv4 style ZFS ACLs used on the platform. This makes it
difficult to observe that a pool imported from FreeBSD on Linux has a
different type of ACL that is being ignored, and vice versa.
Add an nfsv4 acltype and expose the property on FreeBSD.
Make the default acltype nfsv4 on FreeBSD.
Setting acltype to an unhanded style is treated the same as setting
it to off. The ACLs will not be removed, but they will be ignored.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10520
Diffstat (limited to 'module/zcommon')
-rw-r--r-- | module/zcommon/zfs_prop.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index f3dbbc15d..0352b13aa 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -254,6 +254,7 @@ zfs_prop_init(void) static zprop_index_t acltype_table[] = { { "off", ZFS_ACLTYPE_OFF }, { "posix", ZFS_ACLTYPE_POSIX }, + { "nfsv4", ZFS_ACLTYPE_NFSV4 }, { "disabled", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */ { "noacl", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */ { "posixacl", ZFS_ACLTYPE_POSIX }, /* bkwrd compatibility */ @@ -428,11 +429,15 @@ zfs_prop_init(void) PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | groupmask | passthrough | restricted", "ACLMODE", acl_mode_table); -#ifndef __FreeBSD__ - zprop_register_index(ZFS_PROP_ACLTYPE, "acltype", ZFS_ACLTYPE_OFF, - PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, - "off | posix", "ACLTYPE", acltype_table); + zprop_register_index(ZFS_PROP_ACLTYPE, "acltype", +#ifdef __linux__ + /* Linux doesn't natively support ZFS's NFSv4-style ACLs. */ + ZFS_ACLTYPE_OFF, +#else + ZFS_ACLTYPE_NFSV4, #endif + PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, + "off | nfsv4 | posix", "ACLTYPE", acltype_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", @@ -702,12 +707,6 @@ zfs_prop_init(void) * that we don't have to change the values of the zfs_prop_t enum, or * have NULL pointers in the zfs_prop_table[]. */ -#ifdef __FreeBSD__ - zprop_register_impl(ZFS_PROP_ACLTYPE, "acltype", PROP_TYPE_INDEX, - ZFS_ACLTYPE_OFF, NULL, PROP_INHERIT, - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, - "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"); |