Skip to contentSkip to conversation

nfs: Leave pages in the pagecache if readpage failed

PATCH In review Kuniyuki Iwashima 2 participants 2 messages Jun 26, 2024 – Jul 2, 2024 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: Leave pages in the pagecache if readpage failed

From: "Matthew Wilcox (Oracle)" <[email protected]>

commit 0b768a9610c6de9811c6d33900bebfb665192ee1 upstream

The pagecache handles readpage failing by itself; it doesn't want filesystems to remove pages from under it.

---
When NFS server returns NFS4ERR_SERVERFAULT, the client returned Remote I/O error immediately on 4.14 and 6.1, but on 5.4/5.10/5.15, the client retries forever and get stuck until userspace aborts it.

The patch fixed the issue but did not have Fixes: tag.

Please backport this to 5.4/5.10/5.15.

---
 fs/nfs/read.c | 4 ----
 1 file changed, 4 deletions(-)
fs/nfs/read.c +0 -4
index 08d6cc57cbc3..b02372ec07a5 100644
@@ -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);
Signature · 1 line
2.30.2
#1 lore raw
Quoted 9 lines · Kuniyuki Iwashima

From: "Matthew Wilcox (Oracle)" <[email protected]>

commit 0b768a9610c6de9811c6d33900bebfb665192ee1 upstream

The pagecache handles readpage failing by itself; it doesn't want filesystems to remove pages from under it.

Quoted 8 lines

---
When NFS server returns NFS4ERR_SERVERFAULT, the client returned Remote I/O error immediately on 4.14 and 6.1, but on 5.4/5.10/5.15, the client retries forever and get stuck until userspace aborts it.

The patch fixed the issue but did not have Fixes: tag.

Please backport this to 5.4/5.10/5.15.

Now queued up, thanks.

greg k-h