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

Commit 82cf4f13 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: fix to active page in lru list for read path



If config CONFIG_F2FS_FAULT_INJECTION is on, for both read or write path
we will call find_lock_page() to get the page, but for read path, it
missed to passing FGP_ACCESSED to allocator to active the page in LRU
list, result in being reclaimed in advance incorrectly, fix it.

Reported-by: default avatarXianrong Zhou <zhouxianrong@huawei.com>
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 18767e62
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1964,8 +1964,13 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
						pgoff_t index, bool for_write)
{
#ifdef CONFIG_F2FS_FAULT_INJECTION
	struct page *page = find_lock_page(mapping, index);
	struct page *page;

	if (!for_write)
		page = find_get_page_flags(mapping, index,
						FGP_LOCK | FGP_ACCESSED);
	else
		page = find_lock_page(mapping, index);
	if (page)
		return page;