Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2018 04:27:05 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r328247 - in vendor-sys/illumos/dist/uts/common: fs/zfs sys/sysevent
Message-ID:  <201801220427.w0M4R57H025273@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jan 22 04:27:05 2018
New Revision: 328247
URL: https://svnweb.freebsd.org/changeset/base/328247

Log:
  8959 Add notifications when a scrub is paused or resumed
  
  illumos/illumos-gate@301fd1d6f25595cd8c6d6795f39c72d97aff8cd9
  
  Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Approved by: Gordon Ross <gwr@nexenta.com>
  Author: Sean Eric Fagan <sef@ixsystems.com>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
  vendor-sys/illumos/dist/uts/common/sys/sysevent/eventdefs.h

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c	Mon Jan 22 04:23:48 2018	(r328246)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c	Mon Jan 22 04:27:05 2018	(r328247)
@@ -363,6 +363,7 @@ dsl_scan_cancel_sync(void *arg, dmu_tx_t *tx)
 
 	dsl_scan_done(scn, B_FALSE, tx);
 	dsl_scan_sync_state(scn, tx);
+	spa_event_notify(scn->scn_dp->dp_spa, NULL, NULL, ESC_ZFS_SCRUB_ABORT);
 }
 
 int
@@ -417,6 +418,7 @@ dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx)
 		spa->spa_scan_pass_scrub_pause = gethrestime_sec();
 		scn->scn_phys.scn_flags |= DSF_SCRUB_PAUSED;
 		dsl_scan_sync_state(scn, tx);
+		spa_event_notify(spa, NULL, NULL, ESC_ZFS_SCRUB_PAUSED);
 	} else {
 		ASSERT3U(*cmd, ==, POOL_SCRUB_NORMAL);
 		if (dsl_scan_is_paused_scrub(scn)) {
@@ -1986,8 +1988,10 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func)
 		/* got scrub start cmd, resume paused scrub */
 		int err = dsl_scrub_set_pause_resume(scn->scn_dp,
 		    POOL_SCRUB_NORMAL);
-		if (err == 0)
+		if (err == 0) {
+			spa_event_notify(spa, NULL, NULL, ESC_ZFS_SCRUB_RESUME);
 			return (ECANCELED);
+		}
 
 		return (SET_ERROR(err));
 	}

Modified: vendor-sys/illumos/dist/uts/common/sys/sysevent/eventdefs.h
==============================================================================
--- vendor-sys/illumos/dist/uts/common/sys/sysevent/eventdefs.h	Mon Jan 22 04:23:48 2018	(r328246)
+++ vendor-sys/illumos/dist/uts/common/sys/sysevent/eventdefs.h	Mon Jan 22 04:27:05 2018	(r328247)
@@ -203,6 +203,9 @@ extern "C" {
 #define	ESC_ZFS_CONFIG_SYNC		"ESC_ZFS_config_sync"
 #define	ESC_ZFS_SCRUB_START		"ESC_ZFS_scrub_start"
 #define	ESC_ZFS_SCRUB_FINISH		"ESC_ZFS_scrub_finish"
+#define	ESC_ZFS_SCRUB_ABORT		"ESC_ZFS_scrub_abort"
+#define	ESC_ZFS_SCRUB_RESUME		"ESC_ZFS_scrub_resume"
+#define	ESC_ZFS_SCRUB_PAUSED		"ESC_ZFS_scrub_paused"
 #define	ESC_ZFS_VDEV_SPARE		"ESC_ZFS_vdev_spare"
 #define	ESC_ZFS_BOOTFS_VDEV_ATTACH	"ESC_ZFS_bootfs_vdev_attach"
 #define	ESC_ZFS_POOL_REGUID		"ESC_ZFS_pool_reguid"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801220427.w0M4R57H025273>