Skip to content

Commit

Permalink
ZIL: Change ZIOs issue order.
Browse files Browse the repository at this point in the history
In zil_lwb_write_issue(), after issuing lwb_root_zio/lwb_write_zio,
we have no right to access lwb->lwb_child_zio. If it was not there,
the first two ZIOs may have already completed and freed the lwb.
ZIOs issue in opposite order from children to parent should keep
the lwb valid till the end, since the lwb can be freed only after
lwb_root_zio completion callback.

Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
  • Loading branch information
amotin committed Sep 1, 2023
1 parent eda3fcd commit db1d254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,10 +1929,10 @@ zil_lwb_write_issue(zilog_t *zilog, lwb_t *lwb)
BP_GET_LSIZE(&lwb->lwb_blk));
}
lwb->lwb_issued_timestamp = gethrtime();
zio_nowait(lwb->lwb_root_zio);
zio_nowait(lwb->lwb_write_zio);
if (lwb->lwb_child_zio)
zio_nowait(lwb->lwb_child_zio);
zio_nowait(lwb->lwb_write_zio);
zio_nowait(lwb->lwb_root_zio);

/*
* If nlwb was ready when we gave it the block pointer,
Expand Down

0 comments on commit db1d254

Please sign in to comment.