summaryrefslogtreecommitdiffstats
path: root/module/zfs/zil.c
diff options
context:
space:
mode:
authorAndriy Gapon <[email protected]>2017-07-17 15:31:30 +0300
committerBrian Behlendorf <[email protected]>2017-07-28 14:08:20 -0700
commite98b6117252acb4931bbcc0ff6b164269273de4e (patch)
treedde0b715eeffc7af5c630cf2c613e1201ca54e66 /module/zfs/zil.c
parent0f69f42b43637548bec225ed25fa71b032de114e (diff)
OpenZFS 8373 - TXG_WAIT in ZIL commit path
Authored by: Andriy Gapon <[email protected]> Reviewed by: Prakash Surya <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8373 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/7f04961 Closes #6403
Diffstat (limited to 'module/zfs/zil.c')
-rw-r--r--module/zfs/zil.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index 6a1f190f5..6b0346893 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -1009,7 +1009,24 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
* to clean up in the event of allocation failure or I/O failure.
*/
tx = dmu_tx_create(zilog->zl_os);
- VERIFY(dmu_tx_assign(tx, TXG_WAIT) == 0);
+
+ /*
+ * Since we are not going to create any new dirty data and we can even
+ * help with clearing the existing dirty data, we should not be subject
+ * to the dirty data based delays.
+ * We (ab)use TXG_WAITED to bypass the delay mechanism.
+ * One side effect from using TXG_WAITED is that dmu_tx_assign() can
+ * fail if the pool is suspended. Those are dramatic circumstances,
+ * so we return NULL to signal that the normal ZIL processing is not
+ * possible and txg_wait_synced() should be used to ensure that the data
+ * is on disk.
+ */
+ error = dmu_tx_assign(tx, TXG_WAITED);
+ if (error != 0) {
+ ASSERT3S(error, ==, EIO);
+ dmu_tx_abort(tx);
+ return (NULL);
+ }
dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
txg = dmu_tx_get_txg(tx);