mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
OpenZFS 8959 - Add notifications when a scrub is paused or resumed
Authored by: Sean Eric Fagan <sef@ixsystems.com> Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Gordon Ross <gwr@nexenta.com> Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov> Porting Notes: - Brought #defines in eventdefs.h in line with ZFS on Linux format. - Updated zfs-events.5 with the new events. OpenZFS-issue: https://www.illumos.org/issues/8959 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c862b93eea Closes #7049
This commit is contained in:
committed by
Brian Behlendorf
parent
3da3488e63
commit
43cb30b3ce
@@ -714,8 +714,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));
|
||||
}
|
||||
@@ -842,6 +844,7 @@ dsl_scan_cancel_sync(void *arg, dmu_tx_t *tx)
|
||||
|
||||
dsl_scan_done(scn, B_FALSE, tx);
|
||||
dsl_scan_sync_state(scn, tx, SYNC_MANDATORY);
|
||||
spa_event_notify(scn->scn_dp->dp_spa, NULL, NULL, ESC_ZFS_SCRUB_ABORT);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -886,6 +889,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, SYNC_CACHED);
|
||||
spa_event_notify(spa, NULL, NULL, ESC_ZFS_SCRUB_PAUSED);
|
||||
} else {
|
||||
ASSERT3U(*cmd, ==, POOL_SCRUB_NORMAL);
|
||||
if (dsl_scan_is_paused_scrub(scn)) {
|
||||
|
||||
Reference in New Issue
Block a user