• Darrick J. Wong's avatar
    xfs: check deferred refcount op continuation parameters · 8edbe0cf
    Darrick J. Wong authored
    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: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    8edbe0cf
xfs_refcount.c 48.7 KB