Remove KASSERT check for negative bio_offsets, add "normal" EIO
error return for same.
This commit is contained in:
parent
ac42a2c196
commit
d1b8bf476c
@ -386,9 +386,6 @@ g_dev_strategy(struct bio *bp)
|
||||
tsleep(&bp, PRIBIO, "gdstrat", hz / 10);
|
||||
}
|
||||
KASSERT(bp2 != NULL, ("XXX: ENOMEM in a bad place"));
|
||||
KASSERT(bp2->bio_offset >= 0,
|
||||
("Negative bio_offset (%jd) on bio %p",
|
||||
(intmax_t)bp2->bio_offset, bp));
|
||||
bp2->bio_length = (off_t)bp->bio_bcount;
|
||||
bp2->bio_done = g_dev_done;
|
||||
g_trace(G_T_BIO,
|
||||
|
@ -221,7 +221,9 @@ g_io_check(struct bio *bp)
|
||||
/* Reject I/O not integral sector long */
|
||||
if (bp->bio_length % pp->sectorsize)
|
||||
return (EINVAL);
|
||||
/* Reject requests past the end of media. */
|
||||
/* Reject requests before or past the end of media. */
|
||||
if (bp->bio_offset < 0)
|
||||
return (EIO);
|
||||
if (bp->bio_offset > pp->mediasize)
|
||||
return (EIO);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user