diff --git a/mm/filemap.c b/mm/filemap.c
index 439b2bea8e34211a8da7f800d66f2a4ce9d674c9..93595c327bbdc43fcea91b513fd750d1a73edfec 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1379,8 +1379,13 @@ static struct page * filemap_getpage(struct file *file, unsigned long pgoff,
 	 * Ok, found a page in the page cache, now we need to check
 	 * that it's up-to-date.
 	 */
-	if (!PageUptodate(page))
+	if (!PageUptodate(page)) {
+		if (nonblock) {
+			page_cache_release(page);
+			return NULL;
+		}
 		goto page_not_uptodate;
+	}
 
 success:
 	/*