Skip to content

Commit

Permalink
Use bread() instead of cluster_read() for reading the last block
Browse files Browse the repository at this point in the history
in a file.  There was a (harmless, I think) off-by-1 error.  This
was fixed in ufs long ago (rev.1.21 of ufs_readwrite.c) but not
in cd9660.

cd9660_read() has stagnated in many other ways.  It is closer to
the Net/2 ufs_read() (which is was cloned from) than ufs_read()
itself is.
  • Loading branch information
Bruce Evans authored and Bruce Evans committed Oct 27, 1997
1 parent f6e4fb2 commit 5a5573f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sys/fs/cd9660/cd9660_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
* $Id: cd9660_vnops.c,v 1.47 1997/10/26 20:55:09 phk Exp $
* $Id: cd9660_vnops.c,v 1.48 1997/10/27 13:33:37 bde Exp $
*/

#include <sys/param.h>
Expand Down Expand Up @@ -284,7 +284,7 @@ cd9660_read(ap)
size = blksize(imp, ip, lbn);
rablock = lbn + 1;
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
if (lblktosize(imp, rablock) <= ip->i_size)
if (lblktosize(imp, rablock) < ip->i_size)
error = cluster_read(vp, (off_t)ip->i_size,
lbn, size, NOCRED, uio->uio_resid,
(ap->a_ioflag >> 16), &bp);
Expand Down
4 changes: 2 additions & 2 deletions sys/isofs/cd9660/cd9660_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
* $Id: cd9660_vnops.c,v 1.47 1997/10/26 20:55:09 phk Exp $
* $Id: cd9660_vnops.c,v 1.48 1997/10/27 13:33:37 bde Exp $
*/

#include <sys/param.h>
Expand Down Expand Up @@ -284,7 +284,7 @@ cd9660_read(ap)
size = blksize(imp, ip, lbn);
rablock = lbn + 1;
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
if (lblktosize(imp, rablock) <= ip->i_size)
if (lblktosize(imp, rablock) < ip->i_size)
error = cluster_read(vp, (off_t)ip->i_size,
lbn, size, NOCRED, uio->uio_resid,
(ap->a_ioflag >> 16), &bp);
Expand Down

0 comments on commit 5a5573f

Please sign in to comment.