]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents
authorDarrick J. Wong <djwong@kernel.org>
Fri, 18 Nov 2022 10:00:45 +0000 (11:00 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 21 Nov 2022 14:26:48 +0000 (15:26 +0100)
commit2d5166b9dd5adc87a1399d4f3b0ef4569526798e
tree5f9347c1ec1ce2d18e2edad6b13b89fddd40c867
parent4b69afdc496caaec1dcd35c22e4c39fb388fd9f0
xfs: make sure aglen never goes negative in xfs_refcount_adjust_extents

Source kernel commit: f850995f60e49818093ef5e477cdb0ff2c11a0a4

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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_refcount.c