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
GitHub <noreply@github.com>Committed on Nov 29 2023, 6:51 PM
Parents
rG8adf2e30665c: Fix zoneid when USER_NS is disabled
Branches
Unknown
Tags
Unknown