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: Jaegeuk Kim <jaegeuk@google.com>
Fixes: 8c95605c41a1 ("f2fs: avoid readahead race condition")
Change-Id: I3a95f0b436d0a5ee420f41d892401a8d79d4fe79
This commit is contained in:
Jaegeuk Kim
2021-11-30 10:22:39 -08:00
parent f711e743ec
commit 7e4f972231

View File

@@ -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;