Skip to content

Commit

Permalink
Handle NULL mirror child vdev
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ned Bass <[email protected]>
Closes openzfs#1744
  • Loading branch information
behlendorf committed Oct 17, 2014
1 parent f0e324f commit 33074f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/vdev_mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 33074f2

Please sign in to comment.