提交 80bcc5f0 编写于 作者: D Darrick J. Wong 提交者: Xie XiuQi

xfs: fix off-by-one error in rtbitmap cross-reference

mainline inclusion
from mainline-5.1-rc1
commit 87c9607df2ff73290dcfe08d22f34687ce0142ce
category: bugfix
bugzilla: 18943
CVE: NA

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

Fix an off-by-one error in the realtime bitmap "is used" cross-reference
helper function if the realtime extent size is a single block.
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: Nyu kuai <yukuai3@huawei.com>
Reviewed-by: Nzhengbin <zhengbin13@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 13ab7d20
...@@ -141,9 +141,8 @@ xchk_xref_is_used_rt_space( ...@@ -141,9 +141,8 @@ xchk_xref_is_used_rt_space(
startext = fsbno; startext = fsbno;
endext = fsbno + len - 1; endext = fsbno + len - 1;
do_div(startext, sc->mp->m_sb.sb_rextsize); do_div(startext, sc->mp->m_sb.sb_rextsize);
if (do_div(endext, sc->mp->m_sb.sb_rextsize)) do_div(endext, sc->mp->m_sb.sb_rextsize);
endext++; extcount = endext - startext + 1;
extcount = endext - startext;
xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount, error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount,
&is_free); &is_free);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册