summaryrefslogtreecommitdiffstats
path: root/cmd/ztest
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-12-06 18:30:15 -0500
committerBrian Behlendorf <[email protected]>2018-01-09 12:27:12 -0800
commit06401e42221d2f5130065caf70f8276ba4d19acd (patch)
treee95a8001f4e7c2411e97239fdc73488c5b4b305c /cmd/ztest
parent460f239e6999195dbcf9b8443c029f07765b21e9 (diff)
Fix ztest_verify_dnode_bt() test case
In ztest_verify_dnode_bt the ztest_object_lock must be held in order to safely verify the unused bonus space. Reviewed-by: DHE <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6941
Diffstat (limited to 'cmd/ztest')
-rw-r--r--cmd/ztest/ztest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 46dd903f8..89ef1c415 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -5172,8 +5172,11 @@ ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id)
dmu_object_info_t doi;
dmu_buf_t *db;
- if (dmu_bonus_hold(os, obj, FTAG, &db) != 0)
+ ztest_object_lock(zd, obj, RL_READER);
+ if (dmu_bonus_hold(os, obj, FTAG, &db) != 0) {
+ ztest_object_unlock(zd, obj);
continue;
+ }
dmu_object_info_from_db(db, &doi);
if (doi.doi_bonus_size >= sizeof (*bt))
@@ -5187,6 +5190,7 @@ ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id)
}
dmu_buf_rele(db, FTAG);
+ ztest_object_unlock(zd, obj);
}
}