Skip to content

Commit

Permalink
xfs: allow empty transactions while frozen
Browse files Browse the repository at this point in the history
In commit e89c041 ("xfs: implement the GETFSMAP ioctl") we
created the ability to obtain empty transactions.  These transactions
have no log or block reservations and therefore can't modify anything.
Since they're also NO_WRITECOUNT they can run while the fs is frozen,
so we don't need to WARN_ON about that usage.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Darrick J. Wong committed Jun 24, 2018
1 parent e53946d commit 10ee252
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/xfs/xfs_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ xfs_trans_alloc(
if (!(flags & XFS_TRANS_NO_WRITECOUNT))
sb_start_intwrite(mp->m_super);

WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
/*
* Zero-reservation ("empty") transactions can't modify anything, so
* they're allowed to run while we're frozen.
*/
WARN_ON(resp->tr_logres > 0 &&
mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
atomic_inc(&mp->m_active_trans);

tp = kmem_zone_zalloc(xfs_trans_zone,
Expand Down

0 comments on commit 10ee252

Please sign in to comment.