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 <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #1744
This commit is contained in:
Brian Behlendorf 2014-10-10 18:12:47 -07:00
parent f0e324f25d
commit 33074f2254

View File

@ -300,7 +300,7 @@ vdev_mirror_child_select(zio_t *zio)
mc = &mm->mm_child[c]; mc = &mm->mm_child[c];
if (mc->mc_tried || mc->mc_skipped) if (mc->mc_tried || mc->mc_skipped)
continue; 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_error = SET_ERROR(ENXIO);
mc->mc_tried = 1; /* don't even try */ mc->mc_tried = 1; /* don't even try */
mc->mc_skipped = 1; mc->mc_skipped = 1;