aboutsummaryrefslogtreecommitdiffstats
path: root/module/os
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2021-05-13 10:00:17 -0700
committerGitHub <[email protected]>2021-05-13 10:00:17 -0700
commit6217656da33c0920cb9f213742fd51dd215bc455 (patch)
treede19bdc11d08ebfbff6b1ed50dd6ba59d727b09c /module/os
parent618a65cd7a77b0b5a27ccdd3e0ff4f80cd14404f (diff)
Revert "Fix raw sends on encrypted datasets when copying back snapshots"
Commit d1d4769 takes into account the encryption key version to decide if the local_mac could be zeroed out. However, this could lead to failure mounting encrypted datasets created with intermediate versions of ZFS encryption available in master between major releases. In order to prevent this situation revert d1d4769 pending a more comprehensive fix which addresses the mount failure case. Reviewed-by: George Amanakis <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #11294 Issue #12025 Issue #12300 Closes #12033
Diffstat (limited to 'module/os')
-rw-r--r--module/os/freebsd/zfs/zio_crypt.c15
-rw-r--r--module/os/linux/zfs/zio_crypt.c15
2 files changed, 2 insertions, 28 deletions
diff --git a/module/os/freebsd/zfs/zio_crypt.c b/module/os/freebsd/zfs/zio_crypt.c
index 89472fe4e..aeb42b304 100644
--- a/module/os/freebsd/zfs/zio_crypt.c
+++ b/module/os/freebsd/zfs/zio_crypt.c
@@ -1077,16 +1077,6 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
bcopy(raw_portable_mac, portable_mac, ZIO_OBJSET_MAC_LEN);
/*
- * This is necessary here as we check next whether
- * OBJSET_FLAG_USERACCOUNTING_COMPLETE or
- * OBJSET_FLAG_USEROBJACCOUNTING are set in order to
- * decide if the local_mac should be zeroed out.
- */
- intval = osp->os_flags;
- if (should_bswap)
- intval = BSWAP_64(intval);
-
- /*
* The local MAC protects the user, group and project accounting.
* If these objects are not present, the local MAC is zeroed out.
*/
@@ -1097,10 +1087,7 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
(datalen >= OBJSET_PHYS_SIZE_V2 &&
osp->os_userused_dnode.dn_type == DMU_OT_NONE &&
osp->os_groupused_dnode.dn_type == DMU_OT_NONE) ||
- (datalen <= OBJSET_PHYS_SIZE_V1) ||
- (((intval & OBJSET_FLAG_USERACCOUNTING_COMPLETE) == 0 ||
- (intval & OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE) == 0) &&
- key->zk_version > 0)) {
+ (datalen <= OBJSET_PHYS_SIZE_V1)) {
bzero(local_mac, ZIO_OBJSET_MAC_LEN);
return (0);
}
diff --git a/module/os/linux/zfs/zio_crypt.c b/module/os/linux/zfs/zio_crypt.c
index 3ccd5914d..94406999c 100644
--- a/module/os/linux/zfs/zio_crypt.c
+++ b/module/os/linux/zfs/zio_crypt.c
@@ -1198,16 +1198,6 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
bcopy(raw_portable_mac, portable_mac, ZIO_OBJSET_MAC_LEN);
/*
- * This is necessary here as we check next whether
- * OBJSET_FLAG_USERACCOUNTING_COMPLETE or
- * OBJSET_FLAG_USEROBJACCOUNTING are set in order to
- * decide if the local_mac should be zeroed out.
- */
- intval = osp->os_flags;
- if (should_bswap)
- intval = BSWAP_64(intval);
-
- /*
* The local MAC protects the user, group and project accounting.
* If these objects are not present, the local MAC is zeroed out.
*/
@@ -1218,10 +1208,7 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
(datalen >= OBJSET_PHYS_SIZE_V2 &&
osp->os_userused_dnode.dn_type == DMU_OT_NONE &&
osp->os_groupused_dnode.dn_type == DMU_OT_NONE) ||
- (datalen <= OBJSET_PHYS_SIZE_V1) ||
- (((intval & OBJSET_FLAG_USERACCOUNTING_COMPLETE) == 0 ||
- (intval & OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE) == 0) &&
- key->zk_version > 0)) {
+ (datalen <= OBJSET_PHYS_SIZE_V1)) {
bzero(local_mac, ZIO_OBJSET_MAC_LEN);
return (0);
}