From 60b6e19785bb3756084924c621df5ecf70990b04 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 10 Dec 2013 20:52:31 +0000 Subject: [PATCH] Only assert the length of the passed bio in the mdstart_vnode() when the bio is unmapped, so we must map the bio pages into pbuf. This works around the geom classes which do not follow the MAXPHYS limit on the i/o size, since such classes do not know about unmapped bios either. Reported by: Paolo Pinto Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 4030a2ddc90..817a89db300 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -746,12 +746,12 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) return (error); } - KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd", - (uintmax_t)bp->bio_length)); if ((bp->bio_flags & BIO_UNMAPPED) == 0) { pb = NULL; aiov.iov_base = bp->bio_data; } else { + KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd", + (uintmax_t)bp->bio_length)); pb = getpbuf(&md_vnode_pbuf_freecnt); pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n); aiov.iov_base = (void *)((vm_offset_t)pb->b_data +