mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix pool creation with feature@allocation_classes disabled
When "feature@allocation_classes" is not enabled on the pool no vdev with "special" or "dedup" allocation type should be allowed to exist in the vdev tree. Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #9427 Closes #9429
This commit is contained in:
committed by
Brian Behlendorf
parent
2516a87821
commit
715c996d3b
@@ -64,6 +64,33 @@ zfs_allocatable_devs(nvlist_t *nv)
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Are there special vdevs?
|
||||
*/
|
||||
boolean_t
|
||||
zfs_special_devs(nvlist_t *nv)
|
||||
{
|
||||
char *bias;
|
||||
uint_t c;
|
||||
nvlist_t **child;
|
||||
uint_t children;
|
||||
|
||||
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
|
||||
&child, &children) != 0) {
|
||||
return (B_FALSE);
|
||||
}
|
||||
for (c = 0; c < children; c++) {
|
||||
if (nvlist_lookup_string(child[c], ZPOOL_CONFIG_ALLOCATION_BIAS,
|
||||
&bias) == 0) {
|
||||
if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0 ||
|
||||
strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) {
|
||||
return (B_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
zpool_get_load_policy(nvlist_t *nvl, zpool_load_policy_t *zlpp)
|
||||
{
|
||||
@@ -223,6 +250,7 @@ zfs_dataset_name_hidden(const char *name)
|
||||
|
||||
#if defined(_KERNEL)
|
||||
EXPORT_SYMBOL(zfs_allocatable_devs);
|
||||
EXPORT_SYMBOL(zfs_special_devs);
|
||||
EXPORT_SYMBOL(zpool_get_load_policy);
|
||||
EXPORT_SYMBOL(zfs_zpl_version_map);
|
||||
EXPORT_SYMBOL(zfs_spa_version_map);
|
||||
|
||||
Reference in New Issue
Block a user