summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-08-14 11:45:47 +0000
committerkib <kib@FreeBSD.org>2012-08-14 11:45:47 +0000
commita3d0fb01750888083d0ed5945f2d835c310c40e6 (patch)
treec57999c31279d4b34edfa4c9044a68251f72d983 /sys/nfsclient
parent45e40c523ad8935b149fdb4ae70172fb3a3c0336 (diff)
downloadFreeBSD-src-a3d0fb01750888083d0ed5945f2d835c310c40e6.zip
FreeBSD-src-a3d0fb01750888083d0ed5945f2d835c310c40e6.tar.gz
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
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 ae35336..0003974 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);
OpenPOWER on IntegriCloud