提交 728c0094 编写于 作者: Y Yu Kuai 提交者: Jialin Zhang

Revert "filemap: Correct the conditions for marking a folio as accessed"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6YDHU
CVE: NA

--------------------------------

This reverts commit 939325bb.

Because this commit make a mistake to judge if the page is the same.
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 40307a4a
...@@ -2530,13 +2530,6 @@ static int generic_file_buffered_read_get_pages(struct kiocb *iocb, ...@@ -2530,13 +2530,6 @@ static int generic_file_buffered_read_get_pages(struct kiocb *iocb,
goto find_page; goto find_page;
} }
static inline bool pos_same_page(loff_t pos1, loff_t pos2, struct page *page)
{
unsigned int shift = page_shift(page);
return (pos1 >> shift == pos2 >> shift);
}
/** /**
* generic_file_buffered_read - generic file read routine * generic_file_buffered_read - generic file read routine
* @iocb: the iocb to read * @iocb: the iocb to read
...@@ -2627,10 +2620,11 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb, ...@@ -2627,10 +2620,11 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb,
writably_mapped = mapping_writably_mapped(mapping); writably_mapped = mapping_writably_mapped(mapping);
/* /*
* When a read accesses a page several times, only * When a sequential read accesses a page several times, only
* mark it as accessed the first time. * mark it as accessed the first time.
*/ */
if (pos_same_page(iocb->ki_pos, ra->prev_pos -1, pages[0])) if (iocb->ki_pos >> PAGE_SHIFT !=
ra->prev_pos >> PAGE_SHIFT)
mark_page_accessed(pages[0]); mark_page_accessed(pages[0]);
for (i = 1; i < pg_nr; i++) for (i = 1; i < pg_nr; i++)
mark_page_accessed(pages[i]); mark_page_accessed(pages[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册