]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/spa.c
Add feature check for 'zpool resilver' command
[mirror_zfs.git] / module / zfs / spa.c
index 5392e35478704cbdff0f40cf0d7a2af92aba317d..4d26d698e09949d8b467d9714528d2f31e26e55a 100644 (file)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2019 by Delphix. All rights reserved.
  * Copyright (c) 2018, Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  * Copyright 2013 Saso Kiselkov. All rights reserved.
@@ -612,8 +612,8 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
                                /*
                                 * Must be ZPL, and its property settings
                                 * must be supported by GRUB (compression
-                                * is not gzip, and large blocks or large
-                                * dnodes are not used).
+                                * is not gzip, and large dnodes are not
+                                * used).
                                 */
 
                                if (dmu_objset_type(os) != DMU_OST_ZFS) {
@@ -5183,6 +5183,7 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
        spa->spa_removing_phys.sr_state = DSS_NONE;
        spa->spa_removing_phys.sr_removing_vdev = -1;
        spa->spa_removing_phys.sr_prev_indirect_vdev = -1;
+       spa->spa_indirect_vdevs_loaded = B_TRUE;
 
        /*
         * Create "The Godfather" zio to hold all async IOs
@@ -7260,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.