]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: check deferred refcount op continuation parameters
authorDarrick J. Wong <djwong@kernel.org>
Fri, 18 Nov 2022 10:02:45 +0000 (11:02 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 21 Nov 2022 14:26:48 +0000 (15:26 +0100)
commit7ccbdec2b832a479836ae9d4c06e54a53f8d7876
tree71784398d489fc68a9ef1cde2b96aedc6d2c8e5b
parentb3f9ae08edf57cbe0e6947a0b66d7c07e02c0639
xfs: check deferred refcount op continuation parameters

Source kernel commit: 8edbe0cf8b4bbe2cf47513998641797b0aca8ee2

If we're in the middle of a deferred refcount operation and decide to
roll the transaction to avoid overflowing the transaction space, we need
to check the new agbno/aglen parameters that we're about to record in
the new intent.  Specifically, we need to check that the new extent is
completely within the filesystem, and that continuation does not put us
into a different AG.

If the keys of a node block are wrong, the lookup to resume an
xfs_refcount_adjust_extents operation can put us into the wrong record
block.  If this happens, we might not find that we run out of aglen at
an exact record boundary, which will cause the loop control to do the
wrong thing.

The previous patch should take care of that problem, but let's add this
extra sanity check to stop corruption problems sooner than later.

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