HomeFreeBSD

ZIL: Fix potential race on flush deferring.

Description

ZIL: Fix potential race on flush deferring.

zil_lwb_set_zio_dependency() can not set write ZIO dependency on
previous LWB's write ZIO if one is already in done handler and set
state to LWB_STATE_WRITE_DONE. So theoretically done handler of
next LWB's write ZIO may run before done handler of previous LWB
write ZIO completes. In such case we can not defer flushes, since
the flush issue process is not locked.

This may fix some reported assertions of lwb_vdev_tree not being
empty inside zil_free_lwb().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15278

Details

Provenance
mavAuthored on Sep 20 2023, 6:17 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 20 2023, 11:41 PM
Parents
rGf7a07d76ee5a: Retire z_nr_znodes
Branches
Unknown
Tags
Unknown