summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2002-07-10 17:02:32 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2002-07-10 17:02:32 +0000
commitd331c5d43f198fc200938122de9a83689f2bed37 (patch)
treee267b121c9bda07891245d5c4f7da3f13b8e5cdf /sys/kern/vfs_cluster.c
parent1116a8c98e01fd4e84a3681d86ffcc990e045996 (diff)
Notes
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 4c11952ab9b2..452dfa12e0cf 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -152,10 +152,13 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
*/
s = splbio();
for (i = 1; i < maxra; i++) {
-
- if (!(tbp = incore(vp, lblkno+i))) {
+ /*
+ * Stop if the buffer does not exist or it
+ * is invalid (about to go away?)
+ */
+ tbp = gbincore(vp, lblkno+i);
+ if (tbp == NULL || (tbp->b_flags & B_INVAL))
break;
- }
/*
* Set another read-ahead mark so we know
@@ -396,7 +399,8 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
* would block in the lock. The same checks have to
* be made again after we officially get the buffer.
*/
- if ((tbp = incore(vp, lbn + i)) != NULL) {
+ if ((tbp = incore(vp, lbn + i)) != NULL &&
+ (tbp->b_flags & B_INVAL) == 0) {
if (BUF_LOCK(tbp, LK_EXCLUSIVE | LK_NOWAIT))
break;
BUF_UNLOCK(tbp);