From: Matthew Wilcox (Oracle) Date: Mon, 16 May 2022 14:30:09 +0000 (-0400) Subject: nfs: Leave pages in the pagecache if readpage failed X-Git-Tag: folio-6.0~40 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0b768a9610c6de9811c6d33900bebfb665192ee1;p=users%2Fwilly%2Fpagecache.git nfs: Leave pages in the pagecache if readpage failed The pagecache handles readpage failing by itself; it doesn't want filesystems to remove pages from under it. Signed-off-by: Matthew Wilcox (Oracle) --- diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 5a9b043662e91..8ae2c8d1219d8 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_fscache_write_page(inode, page); - else if (!PageError(page) && !PagePrivate(page)) - generic_error_remove_page(mapping, page); unlock_page(page); } nfs_release_request(req);