Skip to content

Commit dc078d9

Browse files
committed
ZIL: Force writing of open LWB on suspend
Under parallel workloads ZIL may delay writes of open LWBs that are not full enough. On suspend we do not expect anything new to appear since zil_get_commit_list() will not let it pass, only returning TXG number to wait for. But I suspect that waiting for the TXG commit without having the last LWB issued may not wait for its completion, resulting in panic described in #17509. Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc.
1 parent 4c2a7f8 commit dc078d9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

module/zfs/zil.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,19 +2902,14 @@ zil_process_commit_list(zilog_t *zilog, zil_commit_waiter_t *zcw, list_t *ilwbs)
29022902

29032903
ASSERT(MUTEX_HELD(&zilog->zl_issuer_lock));
29042904

2905-
/*
2906-
* Return if there's nothing to commit before we dirty the fs by
2907-
* calling zil_create().
2908-
*/
2909-
if (list_is_empty(&zilog->zl_itx_commit_list))
2910-
return;
2911-
2912-
list_create(&nolwb_itxs, sizeof (itx_t), offsetof(itx_t, itx_node));
2913-
list_create(&nolwb_waiters, sizeof (zil_commit_waiter_t),
2914-
offsetof(zil_commit_waiter_t, zcw_node));
2915-
29162905
lwb = list_tail(&zilog->zl_lwb_list);
29172906
if (lwb == NULL) {
2907+
/*
2908+
* Return if there's nothing to commit before we dirty the fs.
2909+
*/
2910+
if (list_is_empty(&zilog->zl_itx_commit_list))
2911+
return;
2912+
29182913
lwb = zil_create(zilog);
29192914
} else {
29202915
/*
@@ -2942,6 +2937,10 @@ zil_process_commit_list(zilog_t *zilog, zil_commit_waiter_t *zcw, list_t *ilwbs)
29422937
}
29432938
}
29442939

2940+
list_create(&nolwb_itxs, sizeof (itx_t), offsetof(itx_t, itx_node));
2941+
list_create(&nolwb_waiters, sizeof (zil_commit_waiter_t),
2942+
offsetof(zil_commit_waiter_t, zcw_node));
2943+
29452944
while ((itx = list_remove_head(&zilog->zl_itx_commit_list)) != NULL) {
29462945
lr_t *lrc = &itx->itx_lr;
29472946
uint64_t txg = lrc->lrc_txg;
@@ -3111,7 +3110,8 @@ zil_process_commit_list(zilog_t *zilog, zil_commit_waiter_t *zcw, list_t *ilwbs)
31113110
* possible, without significantly impacting the latency
31123111
* of each individual itx.
31133112
*/
3114-
if (lwb->lwb_state == LWB_STATE_OPENED && !zilog->zl_parallel) {
3113+
if (lwb->lwb_state == LWB_STATE_OPENED &&
3114+
(!zilog->zl_parallel || zilog->zl_suspend > 0)) {
31153115
zil_burst_done(zilog);
31163116
list_insert_tail(ilwbs, lwb);
31173117
lwb = zil_lwb_write_close(zilog, lwb, LWB_STATE_NEW);

0 commit comments

Comments
 (0)