diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-22 02:26:55 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-24 14:56:35 -0400 |
commit | 10ee25268e1f8475905e1deb85bb83627dca561e (patch) | |
tree | 2a897617e8b22c0f8e2e41c0c935082b6ffb4389 | |
parent | e53946dbd31a21f4bef155f8febba556933d62bf (diff) |
xfs: allow empty transactions while frozen
In commit e89c041338ed6ef ("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>
-rw-r--r-- | fs/xfs/xfs_trans.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index e040af120b69..524f543c5b82 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -258,7 +258,12 @@ xfs_trans_alloc( | |||
258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) | 258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) |
259 | sb_start_intwrite(mp->m_super); | 259 | sb_start_intwrite(mp->m_super); |
260 | 260 | ||
261 | WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | 261 | /* |
262 | * Zero-reservation ("empty") transactions can't modify anything, so | ||
263 | * they're allowed to run while we're frozen. | ||
264 | */ | ||
265 | WARN_ON(resp->tr_logres > 0 && | ||
266 | mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | ||
262 | atomic_inc(&mp->m_active_trans); | 267 | atomic_inc(&mp->m_active_trans); |
263 | 268 | ||
264 | tp = kmem_zone_zalloc(xfs_trans_zone, | 269 | tp = kmem_zone_zalloc(xfs_trans_zone, |