zil_fail: fix infinite loop in commit itx search

(cherry picked from commit ba1f888858f8599e10211aa9957d942e7bcc36ce)
This commit is contained in:
Rob Norris 2023-07-26 12:28:01 +10:00 committed by Geoff Amey
parent 6c36d72e71
commit 3cb140863f
1 changed files with 4 additions and 1 deletions

View File

@ -1251,13 +1251,16 @@ zil_fail(zilog_t *zilog)
* how they can legitimately end up here.
*/
l = &itxg->itxg_itxs->i_sync_list;
while ((itx = list_head(l)) != NULL) {
itx = list_head(l);
while (itx != NULL) {
itx_t *nitx = list_next(l, itx);
if (itx->itx_lr.lrc_txtype == TX_COMMIT) {
list_remove(l, itx);
list_insert_tail(&waiters, itx->itx_private);
itx->itx_private = NULL;
zil_itx_destroy(itx);
}
itx = nitx;
}
mutex_exit(&itxg->itxg_lock);