From 33074f2254db76f7237e5a29877558ef920ae325 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 10 Oct 2014 18:12:47 -0700 Subject: [PATCH] Handle NULL mirror child vdev 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 Signed-off-by: Ned Bass Closes #1744 --- module/zfs/vdev_mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c index 99b35f085..17417a0fa 100644 --- a/module/zfs/vdev_mirror.c +++ b/module/zfs/vdev_mirror.c @@ -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;