Blob Blame History Raw
From: Luis Henriques <lhenriques@suse.de>
Subject: NFS: Fix access to page->mapping
Patch-mainline: never, fixed by commit ab75bff11407
References: bsc#1216788

Upstream commit 16f2f4e679cf ("nfs: Implement cache I/O by accessing the
cache directly") introduced a bug that was later fixed by ab75bff11407
("NFS: Convert buffered reads to use folios").  Since SLE15-SP5 hasn't
been converted to folios, this fix hasn't been backported.  Fix it here by
using page_file_mapping() to access mapping->host (inode).

Signed-off-by: Luis Henriques <lhenriques@suse.de>
---
 fs/nfs/read.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -305,8 +305,8 @@ readpage_async_filler(void *data, struct
 
 	aligned_len = min_t(unsigned int, ALIGN(len, rsize), PAGE_SIZE);
 
-	if (!IS_SYNC(page->mapping->host)) {
-		error = nfs_readpage_from_fscache(page->mapping->host, page);
+	if (!IS_SYNC(inode)) {
+		error = nfs_readpage_from_fscache(inode, page);
 		if (error == 0)
 			goto out_unlock;
 	}