提交 75fc2296 编写于 作者: D Darrick J. Wong 提交者: Zheng Zengkai

xfs: fix xfs_reflink_unshare usage of filemap_write_and_wait_range

mainline-inclusion
from mainline-v5.12-rc4
commit d4f74e16
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4KIAO
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4f74e162d238ce00a640af5f0611c3f51dad70e

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

The final parameter of filemap_write_and_wait_range is the end of the
range to flush, not the length of the range to flush.

Fixes: 46afb062 ("xfs: only flush the unshared range in xfs_reflink_unshare")
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NChandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NGuo Xuenan <guoxuenan@huawei.com>
Reviewed-by: NLihong Kou <koulihong@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2dcb6818
......@@ -1503,7 +1503,8 @@ xfs_reflink_unshare(
if (error)
goto out;
error = filemap_write_and_wait_range(inode->i_mapping, offset, len);
error = filemap_write_and_wait_range(inode->i_mapping, offset,
offset + len - 1);
if (error)
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册