diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2020-11-28 12:12:51 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2020-11-28 12:12:51 +0000 |
| commit | cd8537910406e68d4719136a5b0cf6d23bb1b23b (patch) | |
| tree | 7859126225cf7d9249711825e217dceba9857d59 /sys/dev/md | |
| parent | 1b9c78611d9de31ed2f942552549f2b6f7891185 (diff) | |
Notes
Diffstat (limited to 'sys/dev/md')
| -rw-r--r-- | sys/dev/md/md.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 6334e043d0e6..1d17603ffdfe 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -960,9 +960,10 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { pb = uma_zalloc(md_pbuf_zone, M_WAITOK); + MPASS((pb->b_flags & B_MAXPHYS) != 0); bp->bio_resid = len; unmapped_step: - npages = atop(min(MAXPHYS, round_page(len + (ma_offs & + npages = atop(min(maxphys, round_page(len + (ma_offs & PAGE_MASK)))); iolen = min(ptoa(npages) - (ma_offs & PAGE_MASK), len); KASSERT(iolen > 0, ("zero iolen")); @@ -1684,7 +1685,7 @@ kern_mdattach_locked(struct thread *td, struct md_req *mdr) sectsize = DEV_BSIZE; else sectsize = mdr->md_sectorsize; - if (sectsize > MAXPHYS || mdr->md_mediasize < sectsize) + if (sectsize > maxphys || mdr->md_mediasize < sectsize) return (EINVAL); if (mdr->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdr->md_type); |
