Do not invalidate page of the B_NOCACHE buffer or buffer after an I/O

error if any user wired mappings exist.  Doing the invalidation
destroys the user wiring.

The change is the temporal measure to close the bug, the more proper
fix is to delegate the invalidation of the page to upper layers
always.

Reported and tested by:	pho
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2013-07-11 05:36:26 +00:00
parent 30dac21d0a
commit 92e5367354
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253187

View File

@ -1692,7 +1692,8 @@ brelse(struct buf *bp)
KASSERT(presid >= 0, ("brelse: extra page"));
VM_OBJECT_WLOCK(obj);
vm_page_set_invalid(m, poffset, presid);
if (pmap_page_wired_mappings(m) == 0)
vm_page_set_invalid(m, poffset, presid);
VM_OBJECT_WUNLOCK(obj);
if (had_bogus)
printf("avoided corruption bug in bogus_page/brelse code\n");