diff options
author | dillon <dillon@FreeBSD.org> | 1999-09-23 08:41:48 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-09-23 08:41:48 +0000 |
commit | c3199b7ad062a8f76e410357e44a8e69ebae7159 (patch) | |
tree | c23716ea754efb111bd74ff72ec689c81a2aaa10 /sys/geom | |
parent | 4e2e77a0f2f3ce1f209821176b0547dc4be96ffe (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/geom/geom_ccd.c | 11 |
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); /* |