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
GitHub <noreply@github.com>Committed on Sep 20 2023, 6:17 PM
Parents
rG5f1479d92f66: Use ASSERT0P() to check that a pointer is NULL.
Branches
Unknown
Tags
Unknown