aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Wilson <[email protected]>2014-09-05 02:50:36 +0200
committerBrian Behlendorf <[email protected]>2014-09-08 09:42:39 -0700
commit4f68d7878fbed9e225022a1d435cfb7177234110 (patch)
tree1eb153fe5f8900025a267f7faa3b9ce2232bd4f3
parentceb49b0acd21ed44aa8e4d1464447eef071d3bab (diff)
Illumos 5117 - spacemap reallocation can cause corruption
5117 space map reallocation can cause corruption Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Sebastien Roy <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/projects/illumos-gate/issues/5117 https://github.com/illumos/illumos-gate/commit/e503a68 Ported by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2662
-rw-r--r--module/zfs/dnode_sync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c
index 676578859..6ad623998 100644
--- a/module/zfs/dnode_sync.c
+++ b/module/zfs/dnode_sync.c
@@ -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);
@@ -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)) {