mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Illumos #3006
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first
argument is zero
Reviewed by Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by George Wilson <george.wilson@delphix.com>
Approved by Eric Schrock <eric.schrock@delphix.com>
References:
illumos/illumos-gate@fb09f5aad4
https://illumos.org/issues/3006
Requires:
zfsonlinux/spl@1c6d149feb
Ported-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1509
This commit is contained in:
committed by
Brian Behlendorf
parent
9eaf0832ad
commit
c99c90015e
+13
-13
@@ -1039,7 +1039,7 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
|
||||
ztest_record_enospc(FTAG);
|
||||
return (error);
|
||||
}
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
|
||||
setpoint = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
|
||||
VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
|
||||
@@ -1073,7 +1073,7 @@ ztest_spa_prop_set_uint64(zpool_prop_t prop, uint64_t value)
|
||||
ztest_record_enospc(FTAG);
|
||||
return (error);
|
||||
}
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -1776,7 +1776,7 @@ ztest_replay_setattr(ztest_ds_t *zd, lr_setattr_t *lr, boolean_t byteswap)
|
||||
|
||||
ASSERT3U(lr->lr_size, >=, sizeof (*bbt));
|
||||
ASSERT3U(lr->lr_size, <=, db->db_size);
|
||||
VERIFY3U(dmu_set_bonus(db, lr->lr_size, tx), ==, 0);
|
||||
VERIFY0(dmu_set_bonus(db, lr->lr_size, tx));
|
||||
bbt = ztest_bt_bonus(db);
|
||||
|
||||
ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg);
|
||||
@@ -3200,7 +3200,7 @@ ztest_objset_destroy_cb(const char *name, void *arg)
|
||||
error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
|
||||
if (error != ENOENT) {
|
||||
/* We could have crashed in the middle of destroying it */
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
|
||||
ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
|
||||
}
|
||||
@@ -3673,10 +3673,10 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
error = dmu_read(os, packobj, packoff, packsize, packbuf,
|
||||
DMU_READ_PREFETCH);
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
error = dmu_read(os, bigobj, bigoff, bigsize, bigbuf,
|
||||
DMU_READ_PREFETCH);
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
|
||||
/*
|
||||
* Get a tx for the mods to both packobj and bigobj.
|
||||
@@ -3999,10 +3999,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
||||
if (i != 0 || ztest_random(2) != 0) {
|
||||
error = dmu_read(os, packobj, packoff,
|
||||
packsize, packbuf, DMU_READ_PREFETCH);
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
error = dmu_read(os, bigobj, bigoff, bigsize,
|
||||
bigbuf, DMU_READ_PREFETCH);
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
}
|
||||
compare_and_update_pbbufs(s, packbuf, bigbuf, bigsize,
|
||||
n, chunksize, txg);
|
||||
@@ -4287,7 +4287,7 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
|
||||
if (error == ENOENT)
|
||||
goto out;
|
||||
|
||||
ASSERT3U(error, ==, 0);
|
||||
ASSERT0(error);
|
||||
|
||||
tx = dmu_tx_create(os);
|
||||
dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
|
||||
@@ -4494,7 +4494,7 @@ ztest_commit_callback(void *arg, int error)
|
||||
data->zcd_called = B_TRUE;
|
||||
|
||||
if (error == ECANCELED) {
|
||||
ASSERT3U(data->zcd_txg, ==, 0);
|
||||
ASSERT0(data->zcd_txg);
|
||||
ASSERT(!data->zcd_added);
|
||||
|
||||
/*
|
||||
@@ -4704,7 +4704,7 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
|
||||
(void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
|
||||
ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
|
||||
|
||||
VERIFY3U(spa_prop_get(ztest_spa, &props), ==, 0);
|
||||
VERIFY0(spa_prop_get(ztest_spa, &props));
|
||||
|
||||
if (ztest_opts.zo_verbose >= 6)
|
||||
dump_nvlist(props, 4);
|
||||
@@ -5557,7 +5557,7 @@ ztest_dataset_open(int d)
|
||||
}
|
||||
ASSERT(error == 0 || error == EEXIST);
|
||||
|
||||
VERIFY3U(dmu_objset_hold(name, zd, &os), ==, 0);
|
||||
VERIFY0(dmu_objset_hold(name, zd, &os));
|
||||
(void) rw_exit(&ztest_name_lock);
|
||||
|
||||
ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
|
||||
@@ -5757,7 +5757,7 @@ ztest_run(ztest_shared_t *zs)
|
||||
|
||||
/* Verify that at least one commit cb was called in a timely fashion */
|
||||
if (zc_cb_counter >= ZTEST_COMMIT_CB_MIN_REG)
|
||||
VERIFY3U(zc_min_txg_delay, ==, 0);
|
||||
VERIFY0(zc_min_txg_delay);
|
||||
|
||||
spa_close(spa, FTAG);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user