summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 07:20:34 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-02 23:05:14 -0700
commit1ae093cbea3d1ef04e1344b9e3996a9e1763a91b (patch)
tree97ac8b95fb070cadc3f10df8dd1f5b82266a83dd /fs/xfs/xfs_trans.c
parent9b1f4e9831df29776031e86e112e68784f1fc079 (diff)
xfs: replace xfs_defer_ops ->dop_pending with on-stack list
The xfs_defer_ops ->dop_pending list is used to track active deferred operations once intents are logged. These items must be aborted in the event of an error. The list is populated as intents are logged and items are removed as they complete (or are aborted). Now that xfs_defer_finish() cancels on error, there is no need to ever access ->dop_pending outside of xfs_defer_finish(). The list is only ever populated after xfs_defer_finish() begins and is either completed or cancelled before it returns. Remove ->dop_pending from xfs_defer_ops and replace it with a local list in the xfs_defer_finish() path. Pass the local list to the various helpers now that it is not accessible via dfops. Note that we have to check for NULL in the abort case as the final tx roll occurs outside of the scope of the new local list (once the dfops has completed and thus drained the list). Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index b050663c2a70..413e4138357f 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -929,7 +929,7 @@ __xfs_trans_commit(
* Finish deferred items on final commit. Only permanent transactions
* should ever have deferred ops.
*/
- WARN_ON_ONCE(xfs_defer_has_unfinished_work(tp) &&
+ WARN_ON_ONCE(!list_empty(&tp->t_dfops->dop_intake) &&
!(tp->t_flags & XFS_TRANS_PERM_LOG_RES));
if (!regrant && (tp->t_flags & XFS_TRANS_PERM_LOG_RES)) {
error = xfs_defer_finish_noroll(&tp);