Commit 362f5e74 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: assert that we don't enter agfl freeing with a non-permanent transaction

Block allocation requires a permanent transaction for deferred AGFL
frees.  Add an assert in the block allocation path to make explicit and
obvious to future callers the requirement of a transaction with a
permanent reservation.
Reported-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
[darrick: split this out from the previous patch per hch request]
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 945c941f
...@@ -2243,6 +2243,9 @@ xfs_alloc_fix_freelist( ...@@ -2243,6 +2243,9 @@ xfs_alloc_fix_freelist(
xfs_extlen_t need; /* total blocks needed in freelist */ xfs_extlen_t need; /* total blocks needed in freelist */
int error = 0; int error = 0;
/* deferred ops (AGFL block frees) require permanent transactions */
ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
if (!pag->pagf_init) { if (!pag->pagf_init) {
error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp); error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp);
if (error) if (error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment