aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/dbuf.h
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2018-04-17 11:06:54 -0700
committerBrian Behlendorf <[email protected]>2018-04-17 11:06:54 -0700
commit0c03d21ac99ebdbefe65c319fc3712928c40af78 (patch)
tree5ec1e603a374a089fcd5b1c5b673974a5e687c1b /include/sys/dbuf.h
parentb40d45bc6c0e908c4d1086ac8ac3dcd1f7178d2a (diff)
assertion in arc_release() during encrypted receive
In the existing code, when doing a raw (encrypted) zfs receive, we call arc_convert_to_raw() from open context. This creates a race condition between arc_release()/arc_change_state() and writing out the block from syncing context (arc_write_ready/done()). This change makes it so that when we are doing a raw (encrypted) zfs receive, we save the crypt parameters (salt, iv, mac) of dnode blocks in the dbuf_dirty_record_t, and call arc_convert_to_raw() from syncing context when writing out the block of dnodes. Additionally, we can eliminate dr_raw and associated setters, and instead know that dnode blocks are always raw when doing a zfs receive (see the new field os_raw_receive). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #7424 Closes #7429
Diffstat (limited to 'include/sys/dbuf.h')
-rw-r--r--include/sys/dbuf.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h
index 32f036862..ddce7deef 100644
--- a/include/sys/dbuf.h
+++ b/include/sys/dbuf.h
@@ -147,7 +147,16 @@ typedef struct dbuf_dirty_record {
override_states_t dr_override_state;
uint8_t dr_copies;
boolean_t dr_nopwrite;
- boolean_t dr_raw;
+ boolean_t dr_has_raw_params;
+
+ /*
+ * If dr_has_raw_params is set, the following crypt
+ * params will be set on the BP that's written.
+ */
+ boolean_t dr_byteorder;
+ uint8_t dr_salt[ZIO_DATA_SALT_LEN];
+ uint8_t dr_iv[ZIO_DATA_IV_LEN];
+ uint8_t dr_mac[ZIO_DATA_MAC_LEN];
} dl;
} dt;
} dbuf_dirty_record_t;