Index: sys/geom/geom_dev.c =================================================================== --- sys/geom/geom_dev.c +++ sys/geom/geom_dev.c @@ -634,19 +634,6 @@ error = EINVAL; break; } - if ((pp->mediasize > 0) && (offset >= pp->mediasize)) { - /* - * Catch out-of-bounds requests here. The problem is - * that due to historical GEOM I/O implementation - * peculatities, g_delete_data() would always return - * success for requests starting just the next byte - * after providers media boundary. Condition check on - * non-zero media size, since that condition would - * (most likely) cause ENXIO instead. - */ - error = EIO; - break; - } while (length > 0) { chunk = length; if (g_dev_del_max_sectors != 0 && Index: sys/geom/geom_io.c =================================================================== --- sys/geom/geom_io.c +++ sys/geom/geom_io.c @@ -894,6 +894,8 @@ bp->bio_data = ptr; g_io_request(bp, cp); errorc = biowait(bp, "gread"); + if (errorc == 0 && bp->bio_completed != length) + errorc = EIO; if (error != NULL) *error = errorc; g_destroy_bio(bp); @@ -948,6 +950,8 @@ bp->bio_data = ptr; g_io_request(bp, cp); error = biowait(bp, "gwrite"); + if (error == 0 && bp->bio_completed != length) + error = EIO; g_destroy_bio(bp); return (error); } @@ -979,6 +983,8 @@ bp->bio_data = NULL; g_io_request(bp, cp); error = biowait(bp, "gdelete"); + if (error == 0 && bp->bio_completed != length) + error = EIO; g_destroy_bio(bp); return (error); }