summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-06-03 04:40:35 +0000
committerdyson <dyson@FreeBSD.org>1996-06-03 04:40:35 +0000
commit53d543bdd7f96c58be3fe693e0c3c25f8237b36a (patch)
tree444ecd8890bc0ea177c85be83167f925145946d1 /sys/kern
parentdc263de99538080ba11bd1f0a55685c1bc49cba5 (diff)
downloadFreeBSD-src-53d543bdd7f96c58be3fe693e0c3c25f8237b36a.zip
FreeBSD-src-53d543bdd7f96c58be3fe693e0c3c25f8237b36a.tar.gz
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>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_cluster.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 3356fd8..721e6b3 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -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();
OpenPOWER on IntegriCloud