Skip to contentSkip to conversation

filemap: Return the error in do_read_cache_page()

PATCH In review [email protected] 2 participants 2 messages May 22, 2024

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 filemap: Return the error in do_read_cache_page()

From: Trond Myklebust <[email protected]>

If the call to do_read_cache_folio() returns an error, then we should pass that back to the caller of do_read_cache_page().

Fixes 539a3322f208 ("filemap: Add read_cache_folio and read_mapping_folio")
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c +1 -1
index 30de18c4fd28..8f3b3604f73b 100644
@@ -3812,7 +3812,7 @@ static struct page *do_read_cache_page(struct address_space *mapping,
 
 	folio = do_read_cache_folio(mapping, index, filler, file, gfp);
 	if (IS_ERR(folio))
-		return &folio->page;
+		return ERR_CAST(folio);
 	return folio_file_page(folio, index);
 }
 
Signature · 1 line
2.45.1
maintainer
#1 lore raw
Quoted 4 lines · On Wed, May 22, 2024 at 04:31:14PM -0400, [email protected] wrote:

From: Trond Myklebust <[email protected]>

If the call to do_read_cache_folio() returns an error, then we should pass that back to the caller of do_read_cache_page().

this patch is a no-op. it generates exactly the same code. only now it doesn't have the '&folio->page' signature that lets everyone know it's part of the compat code.

Quoted 22 lines
Fixes 539a3322f208 ("filemap: Add read_cache_folio and read_mapping_folio")
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c +1 -1
index 30de18c4fd28..8f3b3604f73b 100644
@@ -3812,7 +3812,7 @@ static struct page *do_read_cache_page(struct address_space *mapping,
 
 	folio = do_read_cache_folio(mapping, index, filler, file, gfp);
 	if (IS_ERR(folio))
-		return &folio->page;
+		return ERR_CAST(folio);
 	return folio_file_page(folio, index);
 }
 
Signature · 1 line
2.45.1