mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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
This commit is contained in:
+1
-2
@@ -1086,8 +1086,7 @@ int dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole,
|
||||
int dmu_read_l0_bps(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t length, struct blkptr *bps, size_t *nbpsp);
|
||||
int dmu_brt_clone(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t length, dmu_tx_t *tx, const struct blkptr *bps, size_t nbps,
|
||||
boolean_t replay);
|
||||
uint64_t length, dmu_tx_t *tx, const struct blkptr *bps, size_t nbps);
|
||||
|
||||
/*
|
||||
* Initial setup and final teardown.
|
||||
|
||||
Reference in New Issue
Block a user