diff options
author | Alexander Motin <mav@FreeBSD.org> | 2014-04-10 10:12:56 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2014-04-10 10:12:56 +0000 |
commit | 66b92c07fe7e0b81aedb21713c8bc12e59a649e3 (patch) | |
tree | bea2298381547952cb4f37aff6060a41960cd78e /sys/geom | |
parent | 43d0f063c2ffd76b2a60e2167cb0f5f8dad56f3c (diff) | |
download | src-66b92c07fe7e0b81aedb21713c8bc12e59a649e3.tar.gz src-66b92c07fe7e0b81aedb21713c8bc12e59a649e3.zip |
Do not increment bio_data in case of BIO_DELETE.
This fixes KASSERT() panic in g_io_request().
Notes
Notes:
svn path=/head/; revision=264313
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/stripe/g_stripe.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index b5d77c5303cf..474d888b4b67 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -472,9 +472,10 @@ g_stripe_start_economic(struct bio *bp, u_int no, off_t offset, off_t length) /* offset -= offset % stripesize; */ offset -= offset & (stripesize - 1); - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; length = bp->bio_length - length; - for (no++; length > 0; no++, length -= stripesize, addr += stripesize) { + for (no++; length > 0; no++, length -= stripesize) { if (no > sc->sc_ndisks - 1) { no = 0; offset += stripesize; @@ -506,6 +507,9 @@ g_stripe_start_economic(struct bio *bp, u_int no, off_t offset, off_t length) cbp->bio_data = addr; cbp->bio_caller2 = sc->sc_disks[no]; + + if (bp->bio_cmd != BIO_DELETE) + addr += stripesize; } /* * Fire off all allocated requests! @@ -632,10 +636,13 @@ g_stripe_start(struct bio *bp) * a provider, so there is nothing to optmize. * and * 4. Request is not unmapped. + * and + * 5. It is not a BIO_DELETE. */ if (g_stripe_fast && bp->bio_length <= MAXPHYS && bp->bio_length >= stripesize * sc->sc_ndisks && - (bp->bio_flags & BIO_UNMAPPED) == 0) { + (bp->bio_flags & BIO_UNMAPPED) == 0 && + bp->bio_cmd != BIO_DELETE) { fast = 1; } error = 0; |