Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
        
@@ -16,12 +16,14 @@
  * fields enclosed by brackets "[]" replaced with your own identifying
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
 /*
  * This file contains the functions which analyze the status of a pool.  This
  * include both the status of an active pool, as well as the status exported
@@ -212,10 +214,24 @@
         if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
             vs->vs_aux == VDEV_AUX_VERSION_NEWER)
                 return (ZPOOL_STATUS_VERSION_NEWER);
 
         /*
+         * Unsupported feature(s).
+         */
+        if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
+            vs->vs_aux == VDEV_AUX_UNSUP_FEAT) {
+                nvlist_t *nvinfo;
+
+                verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
+                    &nvinfo) == 0);
+                if (nvlist_exists(nvinfo, ZPOOL_CONFIG_CAN_RDONLY))
+                        return (ZPOOL_STATUS_UNSUP_FEAT_WRITE);
+                return (ZPOOL_STATUS_UNSUP_FEAT_READ);
+        }
+
+        /*
          * Check that the config is complete.
          */
         if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
             vs->vs_aux == VDEV_AUX_BAD_GUID_SUM)
                 return (ZPOOL_STATUS_BAD_GUID_SUM);
@@ -298,11 +314,11 @@
                 return (ZPOOL_STATUS_REMOVED_DEV);
 
         /*
          * Outdated, but usable, version
          */
-        if (version < SPA_VERSION)
+        if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION)
                 return (ZPOOL_STATUS_VERSION_OLDER);
 
         return (ZPOOL_STATUS_OK);
 }