Fix an error when B_MALLOC buffers are returned from the cluster read

code without the B_READ flag being set.  This is a problem when the
data is not cached, and the result will be a bogus attempted write.
Submitted by:	Kato Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
This commit is contained in:
John Dyson 1996-06-03 04:40:35 +00:00
parent 86064318c4
commit 261fe9665d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16086

View File

@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
* $Id: vfs_cluster.c,v 1.34 1996/01/28 18:25:54 dyson Exp $
* $Id: vfs_cluster.c,v 1.35 1996/03/02 04:40:56 dyson Exp $
*/
#include <sys/param.h>
@ -294,12 +294,13 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run)
}
tbp = getblk(vp, lbn, size, 0, 0);
if (tbp->b_flags & (B_CACHE|B_MALLOC))
if (tbp->b_flags & B_CACHE)
return tbp;
tbp->b_blkno = blkno;
tbp->b_flags |= B_ASYNC | B_READ;
if( ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) )
if( (tbp->b_flags & B_MALLOC) ||
((tbp->b_flags & B_VMIO) == 0) || (run <= 1) )
return tbp;
bp = trypbuf();