diff options
author | Tom Caputi <[email protected]> | 2018-02-27 12:04:05 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-02-27 09:04:05 -0800 |
commit | 095495e0081c16a18641fc60e7c9872123a4f83e (patch) | |
tree | 6bfafa8d3c800a875fb042df43c08922b9cb8747 /module/zfs/dbuf.c | |
parent | 8b5814393f43d7eb7e4319120529d957a5f7bf8e (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #7215
Closes #7236
Diffstat (limited to 'module/zfs/dbuf.c')
-rw-r--r-- | module/zfs/dbuf.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index e885a2756..51cb0c982 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -3465,8 +3465,7 @@ dbuf_check_crypt(dbuf_dirty_record_t *dr) * Writing raw encrypted data requires the db's arc buffer * to be converted to raw by the caller. */ - ASSERT(arc_is_encrypted(db->db_buf) || - db->db.db_object == DMU_META_DNODE_OBJECT); + ASSERT(arc_is_encrypted(db->db_buf)); } } |