diff options
author | Matthew Ahrens <[email protected]> | 2020-12-17 12:11:56 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-12-23 14:34:59 -0800 |
commit | a103ae446ed4aaaac6c83ce242efef313aad2200 (patch) | |
tree | 097bfa129ceeabffb78221cae02f3bb06baa2aa4 /tests | |
parent | 2ab24dfded7f2932a41db36e76805a56b13341ba (diff) |
special device removal space accounting fixes
The space in special devices is not included in spa_dspace (or
dsl_pool_adjustedsize(), or the zfs `available` property). Therefore
there is always at least as much free space in the normal class, as
there is allocated in the special class(es). And therefore, there is
always enough free space to remove a special device.
However, the checks for free space when removing special devices did not
take this into account. This commit corrects that.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #11329
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-runner/bin/zts-report.py.in | 2 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in index 6b5cd191c..05b53bb4c 100755 --- a/tests/test-runner/bin/zts-report.py.in +++ b/tests/test-runner/bin/zts-report.py.in @@ -187,8 +187,6 @@ elif sys.platform.startswith('linux'): # reasons listed above can be used. # maybe = { - 'alloc_class/alloc_class_012_pos': ['FAIL', '9142'], - 'alloc_class/alloc_class_013_pos': ['FAIL', '9142'], 'chattr/setup': ['SKIP', exec_reason], 'cli_root/zdb/zdb_006_pos': ['FAIL', known_reason], 'cli_root/zfs_get/zfs_get_004_pos': ['FAIL', known_reason], diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh index 1cfe6642d..b49a8919e 100755 --- a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh @@ -33,8 +33,9 @@ function file_in_special_vdev # <dataset> <inode> { typeset dataset="$1" typeset inum="$2" + typeset num_normal=$(echo $ZPOOL_DISKS | wc -w | xargs) - zdb -dddddd $dataset $inum | awk '{ + zdb -dddddd $dataset $inum | awk -v d=$num_normal '{ # find DVAs from string "offset level dva" only for L0 (data) blocks if (match($0,"L0 [0-9]+")) { dvas[0]=$3 @@ -49,7 +50,7 @@ if (match($0,"L0 [0-9]+")) { exit 1; } # verify vdev is "special" - if (arr[1] < 3) { + if (arr[1] < d) { exit 1; } } |