mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 02:34:14 +03:00
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 <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10520
This commit is contained in:
committed by
Brian Behlendorf
parent
fbfc7e843a
commit
725c9e22ca
@@ -592,6 +592,14 @@ acl_inherit_changed_cb(void *arg, uint64_t newval)
|
||||
zfsvfs->z_acl_inherit = newval;
|
||||
}
|
||||
|
||||
static void
|
||||
acl_type_changed_cb(void *arg, uint64_t newval)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg;
|
||||
|
||||
zfsvfs->z_acl_type = newval;
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_register_callbacks(vfs_t *vfsp)
|
||||
{
|
||||
@@ -722,6 +730,8 @@ zfs_register_callbacks(vfs_t *vfsp)
|
||||
zfs_prop_to_name(ZFS_PROP_EXEC), exec_changed_cb, zfsvfs);
|
||||
error = error ? error : dsl_prop_register(ds,
|
||||
zfs_prop_to_name(ZFS_PROP_SNAPDIR), snapdir_changed_cb, zfsvfs);
|
||||
error = error ? error : dsl_prop_register(ds,
|
||||
zfs_prop_to_name(ZFS_PROP_ACLTYPE), acl_type_changed_cb, zfsvfs);
|
||||
error = error ? error : dsl_prop_register(ds,
|
||||
zfs_prop_to_name(ZFS_PROP_ACLMODE), acl_mode_changed_cb, zfsvfs);
|
||||
error = error ? error : dsl_prop_register(ds,
|
||||
@@ -797,6 +807,11 @@ zfsvfs_init(zfsvfs_t *zfsvfs, objset_t *os)
|
||||
return (error);
|
||||
zfsvfs->z_case = (uint_t)val;
|
||||
|
||||
error = zfs_get_zplprop(os, ZFS_PROP_ACLTYPE, &val);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
zfsvfs->z_acl_type = (uint_t)val;
|
||||
|
||||
/*
|
||||
* Fold case on file systems that are always or sometimes case
|
||||
* insensitive.
|
||||
@@ -1232,6 +1247,10 @@ zfs_domount(vfs_t *vfsp, char *osname)
|
||||
"xattr", &pval, NULL)))
|
||||
goto out;
|
||||
xattr_changed_cb(zfsvfs, pval);
|
||||
if ((error = dsl_prop_get_integer(osname,
|
||||
"acltype", &pval, NULL)))
|
||||
goto out;
|
||||
acl_type_changed_cb(zfsvfs, pval);
|
||||
zfsvfs->z_issnap = B_TRUE;
|
||||
zfsvfs->z_os->os_sync = ZFS_SYNC_DISABLED;
|
||||
|
||||
@@ -2220,6 +2239,9 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value)
|
||||
case ZFS_PROP_CASE:
|
||||
*value = ZFS_CASE_SENSITIVE;
|
||||
break;
|
||||
case ZFS_PROP_ACLTYPE:
|
||||
*value = ZFS_ACLTYPE_NFSV4;
|
||||
break;
|
||||
default:
|
||||
return (error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user