Skip to contentSkip to conversation

filemap-fix-page_cache_next_miss-when-no-hole-found.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 29, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: filemap: fix page_cache_next_miss() when no hole found
has been removed from the -mm tree. Its filename was
filemap-fix-page_cache_next_miss-when-no-hole-found.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Jan Kara <[email protected]>
Subject: filemap: fix page_cache_next_miss() when no hole found
Date: Tue, 25 Jun 2024 12:18:52 +0200

page_cache_next_miss() should return value outside of the specified range when no hole is found. However currently it will return the last index *in* the specified range confusing ondemand_readahead() to think there's a hole in the searched range and upsetting readahead logic.

---

 mm/filemap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/filemap.c renamed from mm/filemap.c~filemap-fix-page_cache_next_miss-when-no-hole-found +3 -3
@@ -1752,12 +1752,12 @@ pgoff_t page_cache_next_miss(struct addr
 	while (max_scan--) {
 		void *entry = xas_next(&xas);
 		if (!entry || xa_is_value(entry))
-			break;
+			return xas.xa_index;
 		if (xas.xa_index == 0)
-			break;
+			return 0;
 	}
 
-	return xas.xa_index;
+	return index + max_scan;
 }
 EXPORT_SYMBOL(page_cache_next_miss);
 

_

Patches currently in -mm which might be from [email protected] are