In vfs_bio_clrbuf(), ignore the state of the object lock if the page is the

"bogus" page.

Found by:	tegge
This commit is contained in:
Alan Cox 2003-10-12 18:26:48 +00:00
parent 3dbacd2651
commit d58e70a08d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121045

View File

@ -3517,7 +3517,8 @@ vfs_bio_clrbuf(struct buf *bp)
if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE) &&
(bp->b_offset & PAGE_MASK) == 0) {
mask = (1 << (bp->b_bufsize / DEV_BSIZE)) - 1;
VM_OBJECT_LOCK_ASSERT(bp->b_pages[0]->object, MA_OWNED);
if (bp->b_pages[0] != bogus_page)
VM_OBJECT_LOCK_ASSERT(bp->b_pages[0]->object, MA_OWNED);
if ((bp->b_pages[0]->valid & mask) == mask)
goto unlock;
if (((bp->b_pages[0]->flags & PG_ZERO) == 0) &&
@ -3535,7 +3536,8 @@ vfs_bio_clrbuf(struct buf *bp)
(u_long)(vm_offset_t)ea,
(u_long)(vm_offset_t)bp->b_data + bp->b_bufsize);
mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j;
VM_OBJECT_LOCK_ASSERT(bp->b_pages[i]->object, MA_OWNED);
if (bp->b_pages[i] != bogus_page)
VM_OBJECT_LOCK_ASSERT(bp->b_pages[i]->object, MA_OWNED);
if ((bp->b_pages[i]->valid & mask) == mask)
continue;
if ((bp->b_pages[i]->valid & mask) == 0) {