aboutsummaryrefslogtreecommitdiffstats
path: root/module/zcommon
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-10-14 00:25:48 -0400
committerBrian Behlendorf <[email protected]>2020-10-16 13:05:00 -0700
commit725c9e22ca369bb51050b823f0228b847c322678 (patch)
tree183d28f7dbb3c78ee0e70e1763426bd9e7e70569 /module/zcommon
parentfbfc7e843adbd5139e255b56691eb17f286446cd (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.c19
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");