summaryrefslogtreecommitdiff
path: root/sys/geom/geom_ccd.c
diff options
context:
space:
mode:
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 4037f793174c..19d765c53010 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);
/*