Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e4f9722 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

ANDROID: f2fs: check nr_pages for readahead



Old kernel versions have the issue, since upstream f2fs removed this flow by:
commit d4384de9eb5e ("f2fs: Remove readahead collision detection").

Bug: 206148707
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@google.com>
Fixes: 8c95605c41a1 ("f2fs: avoid readahead race condition")
Change-Id: I3a95f0b436d0a5ee420f41d892401a8d79d4fe79
parent f711e743
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2359,6 +2359,10 @@ int f2fs_mpage_readpages(struct address_space *mapping,
	unsigned max_nr_pages = nr_pages;
	int ret = 0;

	/* this is real from f2fs_merkle_tree_readahead() in old kernel only. */
	if (!nr_pages)
		return 0;

	map.m_pblk = 0;
	map.m_lblk = 0;
	map.m_len = 0;