Patch "xfs: don't lose solo superblock counter update transactions" has been added to the 6.12-stable tree
<[email protected]> Tue, 11 Feb 2025 11:32:36 +0100
| Newsgroups | dev.linux.lists.xfs-stable |
|---|---|
| Message-ID | <2025021136-nuzzle-sandworm-08fe@gregkh> |
This is a note to let you know that I've just added the patch titled
xfs: don't lose solo superblock counter update transactions
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-don-t-lose-solo-superblock-counter-update-transactions.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:27:02 2025
From: "Darrick J. Wong" <[email protected]>
Date: Fri, 07 Feb 2025 11:26:48 -0800
Subject: xfs: don't lose solo superblock counter update transactions
To: [email protected], [email protected]
Cc: [email protected], [email protected]
Message-ID: <173895601435.3373740.16661001569520012189.stgit@frogsfrogsfrogs>
From: Darrick J. Wong <[email protected]>
commit c817aabd3b08e8770d89a9a29ae80fead561a1a1 upstream
Superblock counter updates are tracked via per-transaction counters in
the xfs_trans object. These changes are then turned into dirty log
items in xfs_trans_apply_sb_deltas just prior to commiting the log items
to the CIL.
However, updating the per-transaction counter deltas do not cause
XFS_TRANS_DIRTY to be set on the transaction. In other words, a pure sb
counter update will be silently discarded if there are no other dirty
log items attached to the transaction.
This is currently not the case anywhere in the filesystem because sb
counter updates always dirty at least one other metadata item, but let's
not leave a logic bomb.
Cc: <[email protected]> # v2.6.35
Fixes: 0924378a689ccb ("xfs: split out iclog writing from xfs_trans_commit()")
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 | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -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);
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