Author: avg
Date: Mon Jul  6 08:24:57 2015
New Revision: 285197
URL: https://svnweb.freebsd.org/changeset/base/285197

Log:
  MFC r271226: MFV r271223: 5117 space map reallocation can cause corruption
  
  In dnode_sync(), do dnode_increase_indirection() before processing.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c        
Mon Jul  6 05:57:41 2015        (r285196)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c        
Mon Jul  6 08:24:57 2015        (r285197)
@@ -688,6 +688,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);
@@ -712,11 +717,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)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to