ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs
panic message: assertion failed for thread 0xfffffd7fff152a40, thread-id 1: dirobjs + 1 usedobjs (0x28 0x0), file ../ztest.c, line 5822
libc.so.1`_assfail+0x182(fffffd7fffdff1b0, 41aaab, 16be)
libc.so.1`assfail3+0xe6(41b47e, 28, 41ab87, 0, 41aaab, 16be)
I believe the problem is that dsl_dataset_space() is looking at the ds_bp's fill count while dmu_objset_write_ready() is concurrently modifying it. We need to use a lock to protect the ds_bp's contents, similar to how we use the dn_struct_rwlock to protect db_blkptr in dbuf_write_ready(). To fix this we will add an rrwlock to protect the ds_bp.
However, we don't need to lock everywhere. In dbuf_dirty(), ds_bp_rwlock protects os_rootbp. However, in one case we are using os_roobp only in an assertion, so we should only grab ds_bp_rwlock on DEBUG builds. In another case, we use os_roobp inside an "if (dn_dirtyctx == UNDIRTIED)", which is only hit the first time a dnode is accessed, so we should only grab the lock inside that "if".
Updated by Electric Monk over 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit c166b69d29138aed7a415fe7cef698e54c6ae945 Author: Paul Dagnelie <email@example.com> Date: 2016-09-24T17:48:28.000Z 7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs Reviewed by: George Wilson <firstname.lastname@example.org> Reviewed by: Prakash Surya <email@example.com> Reviewed by: Matthew Ahrens <firstname.lastname@example.org> Reviewed by: Steve Gonczi <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>