aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2023-01-04 16:23:28 -0800
committerBrian Behlendorf <[email protected]>2023-01-10 13:27:48 -0800
commit549aafb7c809554fe887e0cb00d280f8e49e9f41 (patch)
treedbec72e29491e38293d53906f05f0606759f4b21 /cmd
parentf7788883ab858b097e05819c241426de84ea10eb (diff)
ztest: ztest_dsl_prop_set_uint64() ENOSPC consistency
It is possible for ztest_dsl_prop_set_uint64() to fail with ENOSPC and this needs to be handled consistently. Reviewed-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #14351
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ztest.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/cmd/ztest.c b/cmd/ztest.c
index 4ef1b1481..a4a59ae4e 100644
--- a/cmd/ztest.c
+++ b/cmd/ztest.c
@@ -2790,12 +2790,12 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
err = ztest_dsl_prop_set_uint64(zd->zd_name,
ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa),
B_FALSE);
- VERIFY(err == 0 || err == ENOSPC);
+ ASSERT(err == 0 || err == ENOSPC);
err = ztest_dsl_prop_set_uint64(zd->zd_name,
ZFS_PROP_COMPRESSION,
ztest_random_dsl_prop(ZFS_PROP_COMPRESSION),
B_FALSE);
- VERIFY(err == 0 || err == ENOSPC);
+ ASSERT(err == 0 || err == ENOSPC);
(void) pthread_rwlock_unlock(&ztest_name_lock);
VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data,
@@ -3347,8 +3347,9 @@ ztest_vdev_class_add(ztest_ds_t *zd, uint64_t id)
spa_special_class(spa)->mc_groups == 1 && ztest_random(2) == 0) {
if (ztest_opts.zo_verbose >= 3)
(void) printf("Enabling special VDEV small blocks\n");
- (void) ztest_dsl_prop_set_uint64(zd->zd_name,
+ error = ztest_dsl_prop_set_uint64(zd->zd_name,
ZFS_PROP_SPECIAL_SMALL_BLOCKS, 32768, B_FALSE);
+ ASSERT(error == 0 || error == ENOSPC);
}
mutex_exit(&ztest_vdev_lock);
@@ -5839,12 +5840,15 @@ ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id)
(void) pthread_rwlock_rdlock(&ztest_name_lock);
- for (int p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
- (void) ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
+ for (int p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++) {
+ int error = ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
+ ASSERT(error == 0 || error == ENOSPC);
+ }
- VERIFY0(ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_RECORDSIZE,
- ztest_random_blocksize(), (int)ztest_random(2)));
+ int error = ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_RECORDSIZE,
+ ztest_random_blocksize(), (int)ztest_random(2));
+ ASSERT(error == 0 || error == ENOSPC);
(void) pthread_rwlock_unlock(&ztest_name_lock);
}