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: Xianrong Zhou <zhouxianrong@huawei.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
ed523c0695
commit
7b4d1de67b
1 changed files with 6 additions and 1 deletions
|
@ -2029,8 +2029,13 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
|
||||||
pgoff_t index, bool for_write)
|
pgoff_t index, bool for_write)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_F2FS_FAULT_INJECTION
|
#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)
|
if (page)
|
||||||
return page;
|
return page;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue