Avoid reading a snapshot block when it is already in the cache.

Update the use of the B_CACHE flag (since the May 1999 commit
that made it the correct test here).

Reported by: Andreas Longwitz <longwitz@incore.de>
Reviewed by: kib
Tested by: Peter Holm
MFC after: 1 week
This commit is contained in:
Kirk McKusick 2017-07-31 20:41:45 +00:00
parent a398d3d182
commit 33bbdde01f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321816

View File

@ -1394,7 +1394,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
*/
bp = getblk(cancelvp, lbn, fs->fs_bsize, 0, 0, 0);
bp->b_blkno = fsbtodb(fs, blkno);
if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0 &&
if ((bp->b_flags & B_CACHE) == 0 &&
(error = readblock(cancelvp, bp, fragstoblks(fs, blkno)))) {
brelse(bp);
return (error);