Skip to content

Commit

Permalink
nfs: Leave pages in the pagecache if readpage failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox (Oracle) committed Jun 29, 2022
1 parent 6e8e79f commit 0b768a9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0b768a9

Please sign in to comment.