Skip to content

Commit

Permalink
zero out dnodes
Browse files Browse the repository at this point in the history
Signed-off-by: George Amanakis <gamanakis@gmail.com>
  • Loading branch information
gamanakis committed Feb 18, 2021
1 parent f76da5a commit f4512d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion module/zfs/dsl_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,12 +2097,22 @@ dsl_crypto_recv_raw_objset_sync(dsl_dataset_t *ds, dmu_objset_type_t ostype,
*/
arc_release(os->os_phys_buf, &os->os_phys_buf);
bcopy(portable_mac, os->os_phys->os_portable_mac, ZIO_OBJSET_MAC_LEN);
bzero(os->os_phys->os_local_mac, ZIO_OBJSET_MAC_LEN);

/*
* Needed for triggering recalculation of metadata
*/
os->os_phys->os_flags &= ~OBJSET_FLAG_USERACCOUNTING_COMPLETE;
os->os_phys->os_flags &= ~OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE;
os->os_flags = os->os_phys->os_flags;
bzero(os->os_phys->os_local_mac, ZIO_OBJSET_MAC_LEN);
os->os_next_write_raw[tx->tx_txg & TXG_MASK] = B_TRUE;

/*
* Needed for zeroing out the local_mac
*/
dmu_object_free(os, DMU_USERUSED_OBJECT, tx);
dmu_object_free(os, DMU_GROUPUSED_OBJECT, tx);

/* set metadnode compression and checksum */
mdn->dn_compress = compress;
mdn->dn_checksum = checksum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ log_must eval "echo password | zfs load-key $ENC_TARGET"
log_must zfs mount $ENC_TARGET
sync

sleep 5

src_uspace=$(( $(zfs userspace -Hp $ENC_SOURCE | grep $QUSER1 | \
awk '{print $4}')/1024/1024))
tgt_uspace=$(( $(zfs userspace -Hp $ENC_TARGET | grep $QUSER1 | \
Expand Down

0 comments on commit f4512d2

Please sign in to comment.