diff options
author | dyson <dyson@FreeBSD.org> | 1998-03-17 17:36:05 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-03-17 17:36:05 +0000 |
commit | 9470d0a235b97a3890cfa09377b8604cbb96fe07 (patch) | |
tree | 5f81b3e11b0ddbd450f7d81c736ccbef596ca83e /sys | |
parent | 89d080d7810197ebb949d308487932b78376a29b (diff) | |
download | FreeBSD-src-9470d0a235b97a3890cfa09377b8604cbb96fe07.zip FreeBSD-src-9470d0a235b97a3890cfa09377b8604cbb96fe07.tar.gz |
Correct a problem where data OR metadata could be thrown away if a
buffer is grown.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_bio.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 9539051..9883e84 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -11,7 +11,7 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vfs_bio.c,v 1.156 1998/03/16 01:55:22 dyson Exp $ + * $Id: vfs_bio.c,v 1.157 1998/03/17 08:41:28 kato Exp $ */ /* @@ -1461,11 +1461,17 @@ loop1: if ((bp->b_flags & B_VMIO) && (size <= bp->b_kvasize)) { allocbuf(bp, size); } else { - bp->b_flags |= B_NOCACHE; if (bp->b_flags & B_DELWRI) { + bp->b_flags |= B_NOCACHE; VOP_BWRITE(bp); } else { - brelse(bp); + if (bp->b_flags & B_VMIO) { + bp->b_flags |= B_RELBUF; + brelse(bp); + } else { + bp->b_flags |= B_NOCACHE; + VOP_BWRITE(bp); + } } goto loop; } |