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.
This commit is contained in:
parent
f6e4fb22cf
commit
5a5573fd8e
@ -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>
|
||||
@ -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);
|
||||
|
@ -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>
|
||||
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user