diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 1f6fa93406c9..ea0d6abf5dea 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -1115,6 +1115,10 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) DB_DNODE_EXIT(db); if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID) { + /* Wait for pending I/O. */ + while (dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC) + cv_wait(&db->db_changed, &db->db_mtx); + /* * If this buffer has already been written out, * we now need to reset its state.