Forgotten commit: If a provider has zero sectorsize, it is an

indication of lack of media.

Tripped up:	peter
This commit is contained in:
phk 2003-10-22 06:32:20 +00:00
parent 7029afbd0e
commit 24c4f38c89

View File

@ -209,12 +209,9 @@ 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);
}
/* Zero sectorsize is a probably lack of media */
if (pp->sectorsize == 0)
return (ENXIO);
/* Reject I/O not on sector boundary */
if (bp->bio_offset % pp->sectorsize)
return (EINVAL);