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:
loli10K
2019-10-11 01:39:41 +02:00
committed by Brian Behlendorf
parent 2516a87821
commit 715c996d3b
4 changed files with 44 additions and 1 deletions
@@ -20,7 +20,8 @@
#
# DESCRIPTION:
# Creating a pool with a special device succeeds.
# Creating a pool with a special device succeeds, but only if
# "feature@allocation_classes" is enabled.
#
verify_runnable "global"
@@ -31,6 +32,9 @@ log_assert $claim
log_onexit cleanup
log_must disk_setup
for type in special dedup; do
log_mustnot zpool create -d $TESTPOOL $CLASS_DISK0 $type $CLASS_DISK1
done
log_must zpool create $TESTPOOL raidz $ZPOOL_DISKS special mirror \
$CLASS_DISK0 $CLASS_DISK1
log_must display_status "$TESTPOOL"