svn commit: r271392 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Xin LI delphij at FreeBSD.org
Wed Sep 10 13:21:45 UTC 2014


Author: delphij
Date: Wed Sep 10 13:21:44 2014
New Revision: 271392
URL: http://svnweb.freebsd.org/changeset/base/271392

Log:
  MFC r271226: MFV r271223:
  
  In dnode_sync(), do dnode_increase_indirection() before processing
  the dn_next_nblkptr.
  
  Illumos issue:
      5117 space map reallocation can cause corruption
  
  Approved by:	re (gjb)

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

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c	Wed Sep 10 13:17:35 2014	(r271391)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c	Wed Sep 10 13:21:44 2014	(r271392)
@@ -684,6 +684,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);
@@ -708,11 +713,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)) {


More information about the svn-src-all mailing list