@@ -834,6 +834,13 @@ __xfs_trans_commit(
trace_xfs_trans_commit(tp, _RET_IP_);
+ /*
+ * Commit per-transaction changes that are not already tracked through
+ * log items. This can add dirty log items to the transaction.
+ */
+ if (tp->t_flags & XFS_TRANS_SB_DIRTY)
+ xfs_trans_apply_sb_deltas(tp);
+
error = xfs_trans_run_precommits(tp);
if (error)
goto out_unreserve;
@@ -864,8 +871,6 @@ __xfs_trans_commit(
/*
* If we need to update the superblock, then do it now.
*/
- if (tp->t_flags & XFS_TRANS_SB_DIRTY)
- xfs_trans_apply_sb_deltas(tp);
xfs_trans_apply_dquot_deltas(tp);
xlog_cil_commit(log, tp, &commit_seq, regrant);