summaryrefslogtreecommitdiffstats
path: root/sys/boot/zfs
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2010-08-09 06:36:11 +0000
committermm <mm@FreeBSD.org>2010-08-09 06:36:11 +0000
commitfe97da49a34a2f5b4193ff5c861ba1a2d063e409 (patch)
tree1b836df2a6d780d4e7351e1faf609c0574a01810 /sys/boot/zfs
parentf0e5a03c1591762c5e41ee125b56c09ce578e635 (diff)
downloadFreeBSD-src-fe97da49a34a2f5b4193ff5c861ba1a2d063e409.zip
FreeBSD-src-fe97da49a34a2f5b4193ff5c861ba1a2d063e409.tar.gz
Return EIO if vdev->v_phys_read is NULL.
This fixes booting from a ZFS mirror with a unavailable primary device. PR: kern/148655 Reviewed by: avg Approved by: delphij (mentor) MFC after: 3 days
Diffstat (limited to 'sys/boot/zfs')
-rw-r--r--sys/boot/zfs/zfsimpl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c
index 5be7afa..e645eba 100644
--- a/sys/boot/zfs/zfsimpl.c
+++ b/sys/boot/zfs/zfsimpl.c
@@ -328,6 +328,9 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void *buf,
size_t psize;
int rc;
+ if (!vdev->v_phys_read)
+ return (EIO);
+
if (bp) {
psize = BP_GET_PSIZE(bp);
} else {
OpenPOWER on IntegriCloud