summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorsimon <simon@FreeBSD.org>2006-06-18 22:01:15 +0000
committersimon <simon@FreeBSD.org>2006-06-18 22:01:15 +0000
commit9d0350bdbe6fe5b7262f15a945b502fbdd590621 (patch)
treea730fad3c2c6fd0c5c21a3721c16555c08681707 /sys/geom
parent14660276aec129de303d24a55f838577d4c9fc0f (diff)
downloadFreeBSD-src-9d0350bdbe6fe5b7262f15a945b502fbdd590621.zip
FreeBSD-src-9d0350bdbe6fe5b7262f15a945b502fbdd590621.tar.gz
In g_dev_strategy(), when failing an IO request with EINVAL due to
offset or request size which is not a multiple of the sector size, make sure that the bio is set to indicate that no data has actually been transferred. The result of this is that the file offset is no longer incremented for these requests. The fact that the file offset was incremented broke fdisk(8)'s probing of sector size for non-512 byte sector sizes. Reviewed by: phk, cperciva Submitted by: mdodd MFC after: 2 weeks
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index bbb4b3a..7b15559 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -353,6 +353,7 @@ g_dev_strategy(struct bio *bp)
if ((bp->bio_offset % cp->provider->sectorsize) != 0 ||
(bp->bio_bcount % cp->provider->sectorsize) != 0) {
+ bp->bio_resid = bp->bio_bcount;
biofinish(bp, NULL, EINVAL);
return;
}
OpenPOWER on IntegriCloud