summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_io.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-11 13:13:10 +0000
committerphk <phk@FreeBSD.org>2003-02-11 13:13:10 +0000
commit064989983a5c0b0af3943d37c80f102710aeec6f (patch)
tree5d3dc97d07618e8b81d54d5151a12cc9968f8218 /sys/geom/geom_io.c
parent3c2e77371c8f7b074c4730479603f2404ec6fb62 (diff)
downloadFreeBSD-src-064989983a5c0b0af3943d37c80f102710aeec6f.zip
FreeBSD-src-064989983a5c0b0af3943d37c80f102710aeec6f.tar.gz
Don't short-circuit zero-length requests of they are BIO_[SG]ETATTR.
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r--sys/geom/geom_io.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index f334817..85ffe33 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -393,16 +393,24 @@ g_io_schedule_down(struct thread *tp __unused)
g_io_deliver(bp, error);
continue;
}
- /* Truncate requests to the end of providers media. */
- excess = bp->bio_offset + bp->bio_length;
- if (excess > bp->bio_to->mediasize) {
- excess -= bp->bio_to->mediasize;
- bp->bio_length -= excess;
- }
- /* Deliver zero length transfers right here. */
- if (bp->bio_length == 0) {
- g_io_deliver(bp, 0);
- continue;
+ switch (bp->bio_cmd) {
+ case BIO_READ:
+ case BIO_WRITE:
+ case BIO_DELETE:
+ /* Truncate requests to the end of providers media. */
+ excess = bp->bio_offset + bp->bio_length;
+ if (excess > bp->bio_to->mediasize) {
+ excess -= bp->bio_to->mediasize;
+ bp->bio_length -= excess;
+ }
+ /* Deliver zero length transfers right here. */
+ if (bp->bio_length == 0) {
+ g_io_deliver(bp, 0);
+ continue;
+ }
+ break;
+ default:
+ break;
}
bp->bio_to->geom->start(bp);
if (pace) {
OpenPOWER on IntegriCloud