diff options
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r-- | sys/geom/geom_io.c | 4 |
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; |