1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Remove KASSERT check for negative bio_offsets, add "normal" EIO

error return for same.
This commit is contained in:
Poul-Henning Kamp 2003-10-19 19:06:54 +00:00
parent ac42a2c196
commit d1b8bf476c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121253
2 changed files with 3 additions and 4 deletions

View File

@ -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,

View File

@ -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;