mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
xfs: Replace ASSERT with XFS_IS_CORRUPT in xfs_rtcopy_summary()
Replace ASSERT(sum > 0) with an XFS_IS_CORRUPT() and place it just after the call to xfs_rtget_summary() so that we don't end up using an illegal value of sum. Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
6de23f81a5
commit
18c16f602a
|
|
@ -112,6 +112,10 @@ xfs_rtcopy_summary(
|
|||
error = xfs_rtget_summary(oargs, log, bbno, &sum);
|
||||
if (error)
|
||||
goto out;
|
||||
if (XFS_IS_CORRUPT(oargs->mp, sum < 0)) {
|
||||
error = -EFSCORRUPTED;
|
||||
goto out;
|
||||
}
|
||||
if (sum == 0)
|
||||
continue;
|
||||
error = xfs_rtmodify_summary(oargs, log, bbno, -sum);
|
||||
|
|
@ -120,7 +124,6 @@ xfs_rtcopy_summary(
|
|||
error = xfs_rtmodify_summary(nargs, log, bbno, sum);
|
||||
if (error)
|
||||
goto out;
|
||||
ASSERT(sum > 0);
|
||||
}
|
||||
}
|
||||
error = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user