Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 7f04961

Browse files
avg-IPrakash Surya
authored andcommitted
8373 TXG_WAIT in ZIL commit path
Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Closes #428
1 parent ed6d032 commit 7f04961

File tree

1 file changed

+18
-1
lines changed
  • usr/src/uts/common/fs/zfs

1 file changed

+18
-1
lines changed

usr/src/uts/common/fs/zfs/zil.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,24 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
974974
* to clean up in the event of allocation failure or I/O failure.
975975
*/
976976
tx = dmu_tx_create(zilog->zl_os);
977-
VERIFY(dmu_tx_assign(tx, TXG_WAIT) == 0);
977+
978+
/*
979+
* Since we are not going to create any new dirty data and we can even
980+
* help with clearing the existing dirty data, we should not be subject
981+
* to the dirty data based delays.
982+
* We (ab)use TXG_WAITED to bypass the delay mechanism.
983+
* One side effect from using TXG_WAITED is that dmu_tx_assign() can
984+
* fail if the pool is suspended. Those are dramatic circumstances,
985+
* so we return NULL to signal that the normal ZIL processing is not
986+
* possible and txg_wait_synced() should be used to ensure that the data
987+
* is on disk.
988+
*/
989+
error = dmu_tx_assign(tx, TXG_WAITED);
990+
if (error != 0) {
991+
ASSERT3S(error, ==, EIO);
992+
dmu_tx_abort(tx);
993+
return (NULL);
994+
}
978995
dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
979996
txg = dmu_tx_get_txg(tx);
980997

0 commit comments

Comments
 (0)