From e4b6b2db124eac51580833d45d83dfde05cbc55c Mon Sep 17 00:00:00 2001 From: Alek P Date: Thu, 24 Aug 2017 10:27:20 -0700 Subject: [PATCH] OpenZFS 8414 - Implemented zpool scrub pause/resume Authored by: Alek Pinchuk Reviewed by: George Melikov Reviewed by: Brian Behlendorf Reviewed by: Brad Lewis Reviewed by: Serapheim Dimitropoulos Reviewed by: Matt Ahrens Reviewed-by: Giuseppe Di Natale Approved by: Dan McDonald Ported-by: Alek Pinchuk OpenZFS-issue: https://www.illumos.org/issues/8414 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c29616076 Closes #6538 --- man/man8/zpool.8 | 8 +++++--- module/zfs/dsl_scan.c | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 index 232d14db51a6..cbc2ab65af62 100644 --- a/man/man8/zpool.8 +++ b/man/man8/zpool.8 @@ -1846,9 +1846,11 @@ Stop scrubbing. .Bl -tag -width Ds .It Fl p Pause scrubbing. -Scrub progress is periodically synced to disk so if the system -is restarted or pool is exported during a paused scrub, the scrub will resume -from the place where it was last checkpointed to disk. +Scrub pause state and progress are periodically synced to disk. +If the system is restarted or pool is exported during a paused scrub, +even after import, scrub will remain paused until it is resumed. +Once resumed the scrub will pick up from the place where it was last +checkpointed to disk. To resume a paused scrub issue .Nm zpool Cm scrub again. diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index d8e3188955e8..b9b1aadf0bf7 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -449,7 +449,6 @@ dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx) spa_t *spa = dp->dp_spa; dsl_scan_t *scn = dp->dp_scan; - if (*cmd == POOL_SCRUB_PAUSE) { /* can't pause a scrub when there is no in-progress scrub */ spa->spa_scan_pass_scrub_pause = gethrestime_sec();