summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_io.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-10-19 19:06:54 +0000
committerphk <phk@FreeBSD.org>2003-10-19 19:06:54 +0000
commitb7c9250fa7b7753965f160c1e05ed1a7b6a99039 (patch)
treecee95886f1ee56a24ea084085966cedbc83c32ae /sys/geom/geom_io.c
parent69b08878f3f1bc66e3ee61d143d258790f1f876a (diff)
downloadFreeBSD-src-b7c9250fa7b7753965f160c1e05ed1a7b6a99039.zip
FreeBSD-src-b7c9250fa7b7753965f160c1e05ed1a7b6a99039.tar.gz
Remove KASSERT check for negative bio_offsets, add "normal" EIO
error return for same.
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r--sys/geom/geom_io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 31d2296..a01f63b 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -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;
OpenPOWER on IntegriCloud