]> git.proxmox.com Git - mirror_zfs.git/commit
ZIL: Revert zl_lock scope reduction.
authorAlexander Motin <mav@FreeBSD.org>
Sat, 2 Sep 2023 00:13:52 +0000 (20:13 -0400)
committerGitHub <noreply@github.com>
Sat, 2 Sep 2023 00:13:52 +0000 (17:13 -0700)
commitb1b99e10a6ccda811c29b50136df24228c3e1d92
tree7bccae7d64120af8a2dfe9876fe15fcec9d3bd13
parentbbcf18c293655d7771e346202413beccc64a69d6
ZIL: Revert zl_lock scope reduction.

While I have no reports of it, I suspect possible use-after-free
scenario when zil_commit_waiter() tries to dereference zcw_lwb
for lwb already freed by zil_sync(), while zcw_done is not set.
Extension of zl_lock scope as it was originally should block
zil_sync() from freeing the lwb, closing this race.

This reverts #14959 and couple chunks of #14841.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15228
module/zfs/zil.c