aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-03-30 21:42:46 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-03-30 21:42:46 +0000
commitbbca4bd7cdc0e8be19250ade52170778b557b928 (patch)
treee7aa4baf545fb6b147ad06aecba0cb6427267045
parent0ac8511aefd3567f06c1ddefa0647ba5d0fb5c74 (diff)
downloadsrc-bbca4bd7cdc0e8be19250ade52170778b557b928.tar.gz
src-bbca4bd7cdc0e8be19250ade52170778b557b928.zip
buffer pager: skip bogus pages.
We cannot validate bogus page by reading a buffer. PR: 244713 Reviewed by: glebius, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24038
Notes
Notes: svn path=/head/; revision=359464
-rw-r--r--sys/kern/vfs_bio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 76ada0709bc9..e15d8a11c631 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -5154,12 +5154,16 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int count,
br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS)
!= 0) ? GB_UNMAPPED : 0;
again:
- for (i = 0; i < count; i++)
- vm_page_busy_downgrade(ma[i]);
+ for (i = 0; i < count; i++) {
+ if (ma[i] != bogus_page)
+ vm_page_busy_downgrade(ma[i]);
+ }
lbnp = -1;
for (i = 0; i < count; i++) {
m = ma[i];
+ if (m == bogus_page)
+ continue;
/*
* Pages are shared busy and the object lock is not
@@ -5228,6 +5232,8 @@ end_pages:
redo = false;
for (i = 0; i < count; i++) {
+ if (ma[i] == bogus_page)
+ continue;
if (vm_page_busy_tryupgrade(ma[i]) == 0) {
vm_page_sunbusy(ma[i]);
ma[i] = vm_page_grab_unlocked(object, ma[i]->pindex,