dmu_tx_wait: handle pool suspension when failmode=continue

Let txg_wait_synced_tx fail, so the caller can retry.

Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
(cherry picked from commit d560d64dbdf853d8fb9e18fc7570bd309091b2e4)
This commit is contained in:
Rob Norris 2023-04-10 20:02:51 +10:00 committed by Geoff Amey
parent 7b7af8ba02
commit 589cea17a9
1 changed files with 13 additions and 2 deletions

View File

@ -1192,8 +1192,19 @@ dmu_tx_wait_flags(dmu_tx_t *tx, txg_wait_flag_t flags)
void void
dmu_tx_wait(dmu_tx_t *tx) dmu_tx_wait(dmu_tx_t *tx)
{ {
/*
return (dmu_tx_wait_flags(tx, TXG_WAIT_F_NONE)); * If we're in a non-blocking failmode, we call dmu_tx_wait_flags() with
* NOSUSPEND to ensure that if we end up in txg_wait_synced_tx(), we
* don't we don't get stuck there.
*
* If the pool does suspend and we're in failmode=continue, the caller
* will call dmu_tx_abort() and then try again. Eventually, it'll land
* back in dmu_tx_assign(NOWAIT), which will return EIO, and the caller
* will enter its error path.
*/
(void) dmu_tx_wait_flags(tx,
(spa_get_failmode(tx->tx_pool->dp_spa) == ZIO_FAILURE_MODE_CONTINUE)
? TXG_WAIT_F_NOSUSPEND : 0);
} }
static void static void