From f76da5a2fce62f4cc6beddd67749d0e905398c0a Mon Sep 17 00:00:00 2001 From: George Amanakis Date: Mon, 14 Dec 2020 20:34:52 +0100 Subject: [PATCH] Revert d1d47691c, aside from test Signed-off-by: George Amanakis --- module/os/freebsd/zfs/zio_crypt.c | 15 +-------------- module/os/linux/zfs/zio_crypt.c | 15 +-------------- 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 9fe678d2574f..f4e69b8ec752 100644 --- a/module/os/freebsd/zfs/zio_crypt.c +++ b/module/os/freebsd/zfs/zio_crypt.c @@ -1076,16 +1076,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 284ca706ede5..dcf94028f47c 100644 --- a/module/os/linux/zfs/zio_crypt.c +++ b/module/os/linux/zfs/zio_crypt.c @@ -1197,16 +1197,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); }