1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

If vm_fault_hold(9) finds that fs.m is wired, do not free it after a

pager error, leave the page to the wire owner.  E.g. the page might be
a part of the invalidated buffer.

Reported and tested by:	pho
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D8197
This commit is contained in:
Konstantin Belousov 2016-10-17 08:17:06 +00:00
parent bd9546a21c
commit 230afe0be6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307501

View File

@ -722,7 +722,10 @@ RetryFault:;
*/
if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) {
vm_page_lock(fs.m);
vm_page_free(fs.m);
if (fs.m->wire_count == 0)
vm_page_free(fs.m);
else
vm_page_xunbusy_maybelocked(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
unlock_and_deallocate(&fs);
@ -742,7 +745,10 @@ RetryFault:;
*/
if (fs.object != fs.first_object) {
vm_page_lock(fs.m);
vm_page_free(fs.m);
if (fs.m->wire_count == 0)
vm_page_free(fs.m);
else
vm_page_xunbusy_maybelocked(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
}