aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-05-02 19:42:31 -0400
committerBrian Behlendorf <[email protected]>2019-05-02 16:42:31 -0700
commitfa241660743d75a97001509c613b400fb60f26be (patch)
tree6a7aa54bd9a83d87ac4f5ab9375255616a477f5f /module
parent85bdc6840190879e4b97364dfa6d93e2877a265e (diff)
Add feature check for 'zpool resilver' command
The 'zpool resilver' command requires that the resilver_defer feature is active on the pool. Unfortunately, the check for this was left out of the original patch. This commit simply corrects this so that the command properly returns an error in this case. Reviewed by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #8700
Diffstat (limited to 'module')
-rw-r--r--module/zfs/spa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index c76163b6f..4d26d698e 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -7261,6 +7261,10 @@ spa_scan(spa_t *spa, pool_scan_func_t func)
if (func >= POOL_SCAN_FUNCS || func == POOL_SCAN_NONE)
return (SET_ERROR(ENOTSUP));
+ if (func == POOL_SCAN_RESILVER &&
+ !spa_feature_is_enabled(spa, SPA_FEATURE_RESILVER_DEFER))
+ return (SET_ERROR(ENOTSUP));
+
/*
* If a resilver was requested, but there is no DTL on a
* writeable leaf device, we have nothing to do.