summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-16 10:30:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-05 09:14:50 +0200
commite710727f439105c5c01c71b58a01d84472cb3548 (patch)
tree3a58fbba5753e092159970835709d2fe879581a0
parenta556ab1925ec3f1582ed6803bd914420c5650075 (diff)
downloadlinux-e710727f439105c5c01c71b58a01d84472cb3548.tar.gz
linux-e710727f439105c5c01c71b58a01d84472cb3548.tar.bz2
linux-e710727f439105c5c01c71b58a01d84472cb3548.zip
nfs: Leave pages in the pagecache if readpage failed
commit 0b768a9610c6de9811c6d33900bebfb665192ee1 upstream. The pagecache handles readpage failing by itself; it doesn't want filesystems to remove pages from under it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/nfs/read.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 08d6cc57cbc3..b02372ec07a5 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -120,12 +120,8 @@ static void nfs_readpage_release(struct nfs_page *req, int error)
if (nfs_error_is_fatal_on_server(error) && error != -ETIMEDOUT)
SetPageError(page);
if (nfs_page_group_sync_on_bit(req, PG_UNLOCKPAGE)) {
- struct address_space *mapping = page_file_mapping(page);
-
if (PageUptodate(page))
nfs_readpage_to_fscache(inode, page, 0);
- else if (!PageError(page) && !PagePrivate(page))
- generic_error_remove_page(mapping, page);
unlock_page(page);
}
nfs_release_request(req);