Skip to content

Commit 4f68d78

Browse files
grwilsonbehlendorf
authored andcommitted
Illumos 5117 - spacemap reallocation can cause corruption
5117 space map reallocation can cause corruption Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Richard Elling <richard.elling@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net> References: https://www.illumos.org/projects/illumos-gate/issues/5117 illumos/illumos-gate@e503a68 Ported by: Turbo Fredriksson <turbo@bayour.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2662
1 parent ceb49b0 commit 4f68d78

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

module/zfs/dnode_sync.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
695695
return;
696696
}
697697

698+
if (dn->dn_next_nlevels[txgoff]) {
699+
dnode_increase_indirection(dn, tx);
700+
dn->dn_next_nlevels[txgoff] = 0;
701+
}
702+
698703
if (dn->dn_next_nblkptr[txgoff]) {
699704
/* this should only happen on a realloc */
700705
ASSERT(dn->dn_allocated_txg == tx->tx_txg);
@@ -720,11 +725,6 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
720725
mutex_exit(&dn->dn_mtx);
721726
}
722727

723-
if (dn->dn_next_nlevels[txgoff]) {
724-
dnode_increase_indirection(dn, tx);
725-
dn->dn_next_nlevels[txgoff] = 0;
726-
}
727-
728728
dbuf_sync_list(list, tx);
729729

730730
if (!DMU_OBJECT_IS_SPECIAL(dn->dn_object)) {

0 commit comments

Comments
 (0)