summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_ccd.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-09-23 08:41:48 +0000
committerdillon <dillon@FreeBSD.org>1999-09-23 08:41:48 +0000
commitc3199b7ad062a8f76e410357e44a8e69ebae7159 (patch)
treec23716ea754efb111bd74ff72ec689c81a2aaa10 /sys/geom/geom_ccd.c
parent4e2e77a0f2f3ce1f209821176b0547dc4be96ffe (diff)
downloadFreeBSD-src-c3199b7ad062a8f76e410357e44a8e69ebae7159.zip
FreeBSD-src-c3199b7ad062a8f76e410357e44a8e69ebae7159.tar.gz
Fix ccdiodone code. The code was using cbp->cb_buf.b_bcount to
sum the total amount of I/O issued to determine when all the I/O has completed. This fails when the EOF boundry occurs in the middle of an I/O. Using cbp->cb_buf.b_bufsize works better.
Diffstat (limited to 'sys/geom/geom_ccd.c')
-rw-r--r--sys/geom/geom_ccd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index 4037f79..19d765c 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -1007,7 +1007,16 @@ ccdiodone(cbp)
return;
}
- count = cbp->cb_buf.b_bcount;
+ /*
+ * use b_bufsize to determine how big the original request was rather
+ * then b_bcount, because b_bcount may have been truncated for EOF.
+ *
+ * XXX We check for an error, but we do not test the resid for an
+ * aligned EOF condition. This may result in character & block
+ * device access not recognizing EOF properly when read or written
+ * sequentially, but will not effect filesystems.
+ */
+ count = cbp->cb_buf.b_bufsize;
putccdbuf(cbp);
/*
OpenPOWER on IntegriCloud