HomeFreeBSD

ZIL: Call brt_pending_add() replaying TX_CLONE_RANGE

Description

ZIL: Call brt_pending_add() replaying TX_CLONE_RANGE

zil_claim_clone_range() takes references on cloned blocks before ZIL
replay. Later zil_free_clone_range() drops them after replay or on
dataset destroy. The total balance is neutral. It means on actual
replay we must take additional references, which would stay in BRT.

Without this blocks could be freed prematurely when either original
file or its clone are destroyed. I've observed BRT being emptied
and the feature being deactivated after ZIL replay completion, which
should not have happened. With the patch I see expected stats.

Reviewed-by: Kay Pedersen <mail@mkwg.de>
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 #15603

Details

Provenance
mavAuthored on Nov 29 2023, 6:51 PM
Tony Hutter <hutter2@llnl.gov>Committed on Nov 29 2023, 9:08 PM
Parents
rGeb34de04d78b: zdb: fix printf() length for uint64_t devid
Branches
Unknown
Tags
Unknown