Patch "xfs: avoid nested calls to __xfs_trans_commit" has been added to the 6.12-stable tree
<[email protected]> Tue, 11 Feb 2025 11:32:27 +0100
| Newsgroups | dev.linux.lists.xfs-stable |
|---|---|
| Message-ID | <2025021127-condense-chump-6f1a@gregkh> |
This is a note to let you know that I've just added the patch titled
xfs: avoid nested calls to __xfs_trans_commit
to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
xfs-avoid-nested-calls-to-__xfs_trans_commit.patch
and it can be found in the queue-6.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
From [email protected] Fri Feb 7 20:26:38 2025
From: "Darrick J. Wong" <[email protected]>
Date: Fri, 07 Feb 2025 11:26:33 -0800
Subject: xfs: avoid nested calls to __xfs_trans_commit
To: [email protected], [email protected]
Cc: [email protected], [email protected]
Message-ID: <173895601419.3373740.4927786739399794017.stgit@frogsfrogsfrogs>
From: Darrick J. Wong <[email protected]>
commit e96c1e2f262e0993859e266e751977bfad3ca98a upstream
Currently, __xfs_trans_commit calls xfs_defer_finish_noroll, which calls
__xfs_trans_commit again on the same transaction. In other words,
there's function recursion that has caused minor amounts of confusion in
the past. There's no reason to keep this around, since there's only one
place where we actually want the xfs_defer_finish_noroll, and that is in
the top level xfs_trans_commit call.
Fixes: 98719051e75ccf ("xfs: refactor internal dfops initialization")
Signed-off-by: "Darrick J. Wong" <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/xfs/xfs_trans.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -834,18 +834,6 @@ __xfs_trans_commit(
trace_xfs_trans_commit(tp, _RET_IP_);
- /*
- * Finish deferred items on final commit. Only permanent transactions
- * should ever have deferred ops.
- */
- WARN_ON_ONCE(!list_empty(&tp->t_dfops) &&
- !(tp->t_flags & XFS_TRANS_PERM_LOG_RES));
- if (!regrant && (tp->t_flags & XFS_TRANS_PERM_LOG_RES)) {
- error = xfs_defer_finish_noroll(&tp);
- if (error)
- goto out_unreserve;
- }
-
error = xfs_trans_run_precommits(tp);
if (error)
goto out_unreserve;
@@ -924,6 +912,20 @@ int
xfs_trans_commit(
struct xfs_trans *tp)
{
+ /*
+ * Finish deferred items on final commit. Only permanent transactions
+ * should ever have deferred ops.
+ */
+ WARN_ON_ONCE(!list_empty(&tp->t_dfops) &&
+ !(tp->t_flags & XFS_TRANS_PERM_LOG_RES));
+ if (tp->t_flags & XFS_TRANS_PERM_LOG_RES) {
+ int error = xfs_defer_finish_noroll(&tp);
+ if (error) {
+ xfs_trans_cancel(tp);
+ return error;
+ }
+ }
+
return __xfs_trans_commit(tp, false);
}
Patches currently in stable-queue which might be from [email protected] are
queue-6.12/xfs-lock-dquot-buffer-before-detaching-dquot-from-b_li_list.patch
queue-6.12/xfs-attach-dquot-buffer-to-dquot-log-item-buffer.patch
queue-6.12/xfs-report-realtime-block-quota-limits-on-realtime-d.patch
queue-6.12/xfs-don-t-over-report-free-space-or-inodes-in-statvf.patch
queue-6.12/xfs-convert-quotacheck-to-attach-dquot-buffers.patch
queue-6.12/xfs-don-t-lose-solo-dquot-update-transactions.patch
queue-6.12/xfs-avoid-nested-calls-to-__xfs_trans_commit.patch
queue-6.12/xfs-release-the-dquot-buf-outside-of-qli_lock.patch
queue-6.12/xfs-clean-up-log-item-accesses-in-xfs_qm_dqflush-_done.patch
queue-6.12/xfs-don-t-lose-solo-superblock-counter-update-transactions.patch
queue-6.12/xfs-add-error-handling-for-xfs_reflink_cancel_cow_range.patch
queue-6.12/xfs-propagate-errors-from-xfs_reflink_cancel_cow_range-in-xfs_dax_write_iomap_end.patch
queue-6.12/xfs-fix-mount-hang-during-primary-superblock-recovery-failure.patch
queue-6.12/xfs-don-t-call-remap_verify_area-with-sb-write-protection-held.patch
queue-6.12/xfs-separate-dquot-buffer-reads-from-xfs_dqflush.patch