- 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.
This commit is contained in:
parent
de54353fb8
commit
abb0e6da6b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112838
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user