L2ARC: Move different stats updates earlier
commita60ed3822b61d6a1cb10d634051e0ab70dcac802
authorAlexander Motin <mav@FreeBSD.org>
Wed, 13 Nov 2024 15:31:50 +0000 (13 10:31 -0500)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2024 15:31:50 +0000 (13 07:31 -0800)
treeaaff2cbc2701011855929eacb153150ae25efac8
parent178682506f92e39a8f6f1de800a471ab9c7bd848
L2ARC: Move different stats updates earlier

..., before we make the header or the log block visible to others.
It should fix assertion on allocated space going negative if the
header is freed once the lock is dropped, while the write is still
going.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16040
Closes #16743
module/zfs/arc.c