]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents
authorDarrick J. Wong <djwong@kernel.org>
Wed, 26 Oct 2022 01:18:21 +0000 (18:18 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 31 Oct 2022 15:58:20 +0000 (08:58 -0700)
commite945dac17880293d464bb8d3b0ca46632b57cbcc
treec2c25e75c9fded537a94a85dfbc973a871cfa998
parent462dd1f797146a61e7ca848ae3769c561abe09fc
xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents

Prior to calling xfs_refcount_adjust_extents, we trimmed agbno/aglen
such that the end of the range would not be in the middle of a refcount
record.  If this is no longer the case, something is seriously wrong
with the btree.  Bail out with a corruption error.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_refcount.c