assertion failed on dnode_sync_free(): avl_is_empty(dn_dbufs)
When syncing the free of a bpobj that was part of a dead list (dnode_sync_free()), we find that it still has held dbufs. The bpobj is still open. It should be closed by dsl_dataset_evict(). The user evict func (dbu_evict_user = dsl_dataset_evict) was dispatched when dsl_destroy_head_sync() released the last hold on the dataset's bonus buffer. However, the task but not yet been executed by the taskq.
We can fix this by calling dmu_buf_user_evict_wait() after processing sync tasks.