Skip to content
Snippets Groups Projects
Commit 80bcc5f0 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by 谢秀奇
Browse files

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


mainline inclusion
from mainline-5.1-rc1
commit 87c9607d
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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avataryu kuai <yukuai3@huawei.com>
Reviewed-by: default avatarzhengbin <zhengbin13@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 13ab7d20
No related branches found
No related tags found
No related merge requests found
......@@ -141,9 +141,8 @@ xchk_xref_is_used_rt_space(
startext = fsbno;
endext = fsbno + len - 1;
do_div(startext, sc->mp->m_sb.sb_rextsize);
if (do_div(endext, sc->mp->m_sb.sb_rextsize))
endext++;
extcount = endext - startext;
do_div(endext, sc->mp->m_sb.sb_rextsize);
extcount = endext - startext + 1;
xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount,
&is_free);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment