Rebase master to b121
[zfs.git] / lib / libzfs / libzfs_status.c
index c7eb04e..44faf02 100644 (file)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -104,6 +104,13 @@ vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs)
        return (state == VDEV_STATE_OFFLINE);
 }
 
+/* ARGSUSED */
+static int
+vdev_removed(uint64_t state, uint64_t aux, uint64_t errs)
+{
+       return (state == VDEV_STATE_REMOVED);
+}
+
 /*
  * Detect if any leaf devices that have seen errors or could not be opened.
  */
@@ -276,6 +283,12 @@ check_status(nvlist_t *config, boolean_t isimport)
                return (ZPOOL_STATUS_OFFLINE_DEV);
 
        /*
+        * Removed device
+        */
+       if (find_vdev_problem(nvroot, vdev_removed))
+               return (ZPOOL_STATUS_REMOVED_DEV);
+
+       /*
         * Currently resilvering
         */
        if (!vs->vs_scrub_complete && vs->vs_scrub_type == POOL_SCRUB_RESILVER)