mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Handle new dnode size in incremental backup stream
When receiving an incremental backup stream, call dmu_object_reclaim_dnsize() if an object's dnode size differs between the incremental source and target. Otherwise it may appear that a dnode which has shrunk is still occupying slots which are in fact free. This will cause a failure to receive new objects that should occupy the now-free slots. Add a test case to verify that an incremental stream containing objects with changed dnode sizes can be received without error. This test case fails without this change. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ned Bass <bass6@llnl.gov> Closes #6366 Closes #6576
This commit is contained in:
committed by
Brian Behlendorf
parent
c8811dec70
commit
65dcb0f67a
@@ -2482,11 +2482,13 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
|
||||
} else if (drro->drr_type != doi.doi_type ||
|
||||
drro->drr_blksz != doi.doi_data_block_size ||
|
||||
drro->drr_bonustype != doi.doi_bonus_type ||
|
||||
drro->drr_bonuslen != doi.doi_bonus_size) {
|
||||
drro->drr_bonuslen != doi.doi_bonus_size ||
|
||||
drro->drr_dn_slots != (doi.doi_dnodesize >> DNODE_SHIFT)) {
|
||||
/* currently allocated, but with different properties */
|
||||
err = dmu_object_reclaim(rwa->os, drro->drr_object,
|
||||
err = dmu_object_reclaim_dnsize(rwa->os, drro->drr_object,
|
||||
drro->drr_type, drro->drr_blksz,
|
||||
drro->drr_bonustype, drro->drr_bonuslen, tx);
|
||||
drro->drr_bonustype, drro->drr_bonuslen,
|
||||
drro->drr_dn_slots << DNODE_SHIFT, tx);
|
||||
}
|
||||
if (err != 0) {
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
Reference in New Issue
Block a user