From 5a5573fd8e5ae138c16eecb88d10a984f6576134 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 27 Oct 1997 14:55:49 +0000 Subject: [PATCH] Use bread() instead of cluster_read() for reading the last block 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. --- sys/fs/cd9660/cd9660_vnops.c | 4 ++-- sys/isofs/cd9660/cd9660_vnops.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index c693c8f81d3..6b0f8017aca 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -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 @@ -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); diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index c693c8f81d3..6b0f8017aca 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -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 @@ -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);