summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 931b7c3..1090c0b 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -309,8 +309,8 @@ g_io_check(struct bio *bp)
case BIO_READ:
case BIO_WRITE:
case BIO_DELETE:
- /* Zero sectorsize is a probably lack of media */
- if (pp->sectorsize == 0)
+ /* Zero sectorsize or mediasize is probably a lack of media. */
+ if (pp->sectorsize == 0 || pp->mediasize == 0)
return (ENXIO);
/* Reject I/O not on sector boundary */
if (bp->bio_offset % pp->sectorsize)
OpenPOWER on IntegriCloud