summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_io.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-08-13 06:42:56 +0000
committerphk <phk@FreeBSD.org>2003-08-13 06:42:56 +0000
commitb35539c7d2df26a29a35790df6a256de016ed94b (patch)
tree99e5134e903ffb882435d23ae75e8d98613052eb /sys/geom/geom_io.c
parent8e205a2f0435f04b31b91c85b8feeb21b6538852 (diff)
downloadFreeBSD-src-b35539c7d2df26a29a35790df6a256de016ed94b.zip
FreeBSD-src-b35539c7d2df26a29a35790df6a256de016ed94b.tar.gz
In case we encounter a zero sectorsize provider in g_io_check(), fail
the request with a printf rather than a divide by zero error.
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r--sys/geom/geom_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 4bed6f6..65828d9 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -209,6 +209,12 @@ g_io_check(struct bio *bp)
case BIO_READ:
case BIO_WRITE:
case BIO_DELETE:
+ /* Noisily reject zero size sectors */
+ if (pp->sectorsize == 0) {
+ printf("GEOM provider %s has zero sectorsize\n",
+ pp->name);
+ return (EDOOFUS);
+ }
/* Reject I/O not on sector boundary */
if (bp->bio_offset % pp->sectorsize)
return (EINVAL);
OpenPOWER on IntegriCloud