HomeFreeBSD

Raw DRR_OBJECT records must write raw data

Description

Raw DRR_OBJECT records must write raw data

b1d21733 made it possible for empty metadnode blocks to be
compressed to a hole, fixing a bug that would cause invalid
metadnode MACs when a send stream attempted to free objects
and allowing the blocks to be reclaimed when they were no
longer needed. However, this patch also introduced a race
condition; if a txg sync occurred after a DRR_OBJECT_RANGE
record was received but before any objects were added, the
metadnode block would be compressed to a hole and lose all
of its encryption parameters. This would cause subsequent
DRR_OBJECT records to fail when they attempted to write
their data into an unencrypted block. This patch defers the
DRR_OBJECT_RANGE handling to receive_object() so that the
encryption parameters are set with each object that is
written into that block.

Reviewed-by: Kash Pande <kash@tripleback.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7215
Closes #7236

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Feb 27 2018, 5:04 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 27 2018, 5:04 PM
Parents
rG8b5814393f43: Incorrect maximum DVA value in DDE_GET_NDVAS()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG095495e0081c: Raw DRR_OBJECT records must write raw data (authored by Tom Caputi <tcaputi@datto.com>).Feb 27 2018, 5:04 PM