Author: mav
Date: Tue Jan 26 12:37:23 2016
New Revision: 294799
URL: https://svnweb.freebsd.org/changeset/base/294799

Log:
  MFV r294798:
  6292 exporting a pool while an async destroy is running can leave entries
  in the deferred tree
  
  Reviewed by: Paul Dagnelie <p...@delphix.com>
  Reviewed by: Matthew Ahrens <mahr...@delphix.com>
  Reviewed by: Andriy Gapon <a...@freebsd.org>
  Reviewed by: Fabian Keil <f...@fabiankeil.de>
  Approved by: Gordon Ross <gordon.r...@nexenta.com>
  
  illumos/illumos-gate@a443cc80c742af740aa82130db840f02b4389365

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c      Tue Jan 
26 12:36:30 2016        (r294798)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c      Tue Jan 
26 12:37:23 2016        (r294799)
@@ -1441,10 +1441,23 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
        }
 
        /*
+        * Only process scans in sync pass 1.
+        */
+       if (spa_sync_pass(dp->dp_spa) > 1)
+               return;
+
+       /*
+        * If the spa is shutting down, then stop scanning. This will
+        * ensure that the scan does not dirty any new data during the
+        * shutdown phase.
+        */
+       if (spa_shutting_down(spa))
+               return;
+
+       /*
         * If the scan is inactive due to a stalled async destroy, try again.
         */
-       if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) ||
-           spa_sync_pass(dp->dp_spa) > 1)
+       if (!scn->scn_async_stalled && !dsl_scan_active(scn))
                return;
 
        scn->scn_visited_this_txg = 0;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to