]> granicus.if.org Git - zfs/commitdiff
Handle NULL mirror child vdev
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 11 Oct 2014 01:12:47 +0000 (18:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 21:59:05 +0000 (14:59 -0700)
When selecting a mirror child it's possible that map allocated by
vdev_mirror_map_allc() contains a NULL for the child vdev.  In
this case the child should be skipped and the read issues to
another member of the mirror.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #1744

module/zfs/vdev_mirror.c

index 99b35f08521e60cbafc6007129fcd9581aeebe82..17417a0fa8321e15af51a512ca63786e4002b10e 100644 (file)
@@ -300,7 +300,7 @@ vdev_mirror_child_select(zio_t *zio)
                mc = &mm->mm_child[c];
                if (mc->mc_tried || mc->mc_skipped)
                        continue;
-               if (!vdev_readable(mc->mc_vd)) {
+               if (mc->mc_vd == NULL || !vdev_readable(mc->mc_vd)) {
                        mc->mc_error = SET_ERROR(ENXIO);
                        mc->mc_tried = 1;       /* don't even try */
                        mc->mc_skipped = 1;