From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: 186896, https://gitee.com/src-openeuler/kernel/issues/I5GZC8 CVE: NA
--------------------------------
This reverts commit 499ecade21fc377c04ec66ed7f0505f1ca74d755.
Prepare to backport solution from mainline.
Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- mm/filemap.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c index ebae261f9df9..9e209e8a3b0d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2551,11 +2551,10 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb, flush_dcache_page(pages[i]);
copied = copy_page_to_iter(pages[i], offset, bytes, iter); - if (copied) { - ra->prev_pos = iocb->ki_pos; - written += copied; - iocb->ki_pos += copied; - } + + written += copied; + iocb->ki_pos += copied; + ra->prev_pos = iocb->ki_pos;
if (copied < bytes) { error = -EFAULT;