aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu.c
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2017-08-23 19:54:24 -0400
committerBrian Behlendorf <[email protected]>2017-08-23 16:54:24 -0700
commit9b8407638da71ea9f4afb21375f991869f19811f (patch)
tree864fd6f860707bbf979aa2f648ec6d7e24434670 /module/zfs/dmu.c
parentdb4c1adaf82db7815baa675d7df3952f46b07ae9 (diff)
Send / Recv Fixes following b52563
This patch fixes several issues discovered after the encryption patch was merged: * Fixed a bug where encrypted datasets could attempt to receive embedded data records. * Fixed a bug where dirty records created by the recv code wasn't properly setting the dr_raw flag. * Fixed a typo where a dmu_tx_commit() was changed to dmu_tx_abort() * Fixed a few error handling bugs unrelated to the encryption patch in dmu_recv_stream() Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #6512 Closes #6524 Closes #6545
Diffstat (limited to 'module/zfs/dmu.c')
-rw-r--r--module/zfs/dmu.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 5b90818f4..1eb35b935 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -2016,6 +2016,25 @@ dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
dnode_rele(dn, FTAG);
}
+/*
+ * Dirty an object and set the dirty record's raw flag. This is used
+ * when writing raw data to an object that will not effect the
+ * encryption parameters, specifically during raw receives.
+ */
+int
+dmu_object_dirty_raw(objset_t *os, uint64_t object, dmu_tx_t *tx)
+{
+ dnode_t *dn;
+ int err;
+
+ err = dnode_hold(os, object, FTAG, &dn);
+ if (err)
+ return (err);
+ dmu_buf_will_change_crypt_params((dmu_buf_t *)dn->dn_dbuf, tx);
+ dnode_rele(dn, FTAG);
+ return (err);
+}
+
int zfs_mdcomp_disable = 0;
/*