Skip to content

Commit

Permalink
=> openzfs#2662: turbo/illumos-5117 - spacemap reallocation can cause…
Browse files Browse the repository at this point in the history
… corruption

Port of Illumos openzfs#5117 (https://reviews.csiden.org/r/80/)
  • Loading branch information
FransUrbo committed Sep 7, 2014
1 parent c7437b4 commit ae6fe66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions module/zfs/dnode_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
return;
}

if (dn->dn_next_nlevels[txgoff]) {
dnode_increase_indirection(dn, tx);
dn->dn_next_nlevels[txgoff] = 0;
}

if (dn->dn_next_nblkptr[txgoff]) {
/* this should only happen on a realloc */
ASSERT(dn->dn_allocated_txg == tx->tx_txg);
Expand All @@ -720,11 +725,6 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
mutex_exit(&dn->dn_mtx);
}

if (dn->dn_next_nlevels[txgoff]) {
dnode_increase_indirection(dn, tx);
dn->dn_next_nlevels[txgoff] = 0;
}

dbuf_sync_list(list, tx);

if (!DMU_OBJECT_IS_SPECIAL(dn->dn_object)) {
Expand Down

0 comments on commit ae6fe66

Please sign in to comment.