summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/libxfs/xfs_defer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index 2713e2d808a7..c4b0eaeb5190 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -424,6 +424,12 @@ xfs_defer_finish(
cleanup_fn(*tp, state, error);
}
+ /*
+ * Roll the transaction once more to avoid returning to the caller
+ * with a dirty transaction.
+ */
+ if ((*tp)->t_flags & XFS_TRANS_DIRTY)
+ error = xfs_defer_trans_roll(tp, dop);
out:
(*tp)->t_dfops = orig_dop;
if (error)