Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenZFS 8373 - TXG_WAIT in ZIL commit path #6403

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion module/zfs/zil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down