]> git.proxmox.com Git - mirror_zfs.git/blobdiff - cmd/zed/agents/zfs_mod.c
zed: detect and offline physically removed devices
[mirror_zfs.git] / cmd / zed / agents / zfs_mod.c
index db9c4c4b75bcf0c242b68c35e8c7f4fa6dc2d262..6d3e7cb112509a0fb9f192a00b503e5869aed6b5 100644 (file)
@@ -476,7 +476,20 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
            &child, &children) == 0) {
                for (c = 0; c < children; c++)
                        zfs_iter_vdev(zhp, child[c], data);
-               return;
+       }
+
+       /*
+        * Iterate over any spares and cache devices
+        */
+       if (nvlist_lookup_nvlist_array(nvl, ZPOOL_CONFIG_SPARES,
+           &child, &children) == 0) {
+               for (c = 0; c < children; c++)
+                       zfs_iter_vdev(zhp, child[c], data);
+       }
+       if (nvlist_lookup_nvlist_array(nvl, ZPOOL_CONFIG_L2CACHE,
+           &child, &children) == 0) {
+               for (c = 0; c < children; c++)
+                       zfs_iter_vdev(zhp, child[c], data);
        }
 
        /* once a vdev was matched and processed there is nothing left to do */