summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-03-30 02:57:32 +0000
committerjeff <jeff@FreeBSD.org>2003-03-30 02:57:32 +0000
commit83e8b193614feba42e1d85e9ee5f58f201f71cb6 (patch)
treea3d9f21599df88e8febef828d6711d3d729f82a8 /sys/kern
parenta5a502558e91ccb0dd4436698739d3c134ba1600 (diff)
downloadFreeBSD-src-83e8b193614feba42e1d85e9ee5f58f201f71cb6.zip
FreeBSD-src-83e8b193614feba42e1d85e9ee5f58f201f71cb6.tar.gz
- We are not guaranteed that read ahead blocks are not in memory already.
Check for B_DELWRI as well as B_CACHED before issuing io on a buffer. This is especially important since we are changing the b_iocmd.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_cluster.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index bd5914e..bd82627 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -264,12 +264,20 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
rbp = cluster_rbuild(vp, filesize, lblkno, blkno,
size, ncontig, NULL);
lblkno += (rbp->b_bufsize / size);
+ if (rbp->b_flags & B_DELWRI) {
+ bqrelse(rbp);
+ continue;
+ }
} else {
rbp = getblk(vp, lblkno, size, 0, 0, 0);
+ lblkno += 1;
+ if (rbp->b_flags & B_DELWRI) {
+ bqrelse(rbp);
+ continue;
+ }
rbp->b_flags |= B_ASYNC | B_RAM;
rbp->b_iocmd = BIO_READ;
rbp->b_blkno = blkno;
- lblkno += 1;
}
if (rbp->b_flags & B_CACHE) {
rbp->b_flags &= ~B_ASYNC;
OpenPOWER on IntegriCloud