aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-08-14 11:45:47 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-08-14 11:45:47 +0000
commitb6c00483e94c0640a6ba4ed49a7399c9ef5d431b (patch)
treec57999c31279d4b34edfa4c9044a68251f72d983 /sys/nfsclient
parent6e8fcacda452f3f892a86d81bc52bd4673e6eb9e (diff)
Do not leave invalid pages in the object after the short read for a
network file systems (not only NFS proper). Short reads cause pages other then the requested one, which were not filled by read response, to stay invalid. Change the vm_page_readahead_finish() interface to not take the error code, but instead to make a decision to free or to (de)activate the page only by its validity. As result, not requested invalid pages are freed even if the read RPC indicated success. Noted and reviewed by: alc MFC after: 1 week
Notes
Notes: svn path=/head/; revision=239246
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_bio.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index ae3533688032..0003974bd68d 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -212,14 +212,18 @@ nfs_getpages(struct vop_getpages_args *ap)
("nfs_getpages: page %p is dirty", m));
} else {
/*
- * Read operation was short. If no error occured
- * we may have hit a zero-fill section. We simply
- * leave valid set to 0.
+ * Read operation was short. If no error
+ * occured we may have hit a zero-fill
+ * section. We leave valid set to 0, and page
+ * is freed by vm_page_readahead_finish() if
+ * its index is not equal to requested, or
+ * page is zeroed and set valid by
+ * vm_pager_get_pages() for requested page.
*/
;
}
if (i != ap->a_reqpage)
- vm_page_readahead_finish(m, error);
+ vm_page_readahead_finish(m);
}
VM_OBJECT_UNLOCK(object);
return (0);