From: Tsu-chieh Chen <tsuchieh.chen@gmail.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Tsu-chieh Chen <tsuchieh.chen@gmail.com>
Subject: [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas
Date: Sat, 27 Jun 2026 18:39:10 -0400 [thread overview]
Message-ID: <20260627223910.129798-1-tsuchieh.chen@gmail.com> (raw)
xfs_qm_mount_quotas() is only called from the mount path, so
m_sb_lock is not needed for serialization when updating sb_qflags.
The code still takes m_sb_lock around the sb_qflags update. Replace the
old XXX comment with an explanation that the lock is taken to keep the
mount-time update consistent with the runtime quota update paths.
No functional change.
Signed-off-by: Tsu-chieh Chen <tsuchieh.chen@gmail.com>
---
fs/xfs/xfs_qm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index aa0d2976f1c3..c2bab12643d3 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1663,8 +1663,9 @@ xfs_qm_mount_quotas(
write_changes:
/*
- * We actually don't have to acquire the m_sb_lock at all.
- * This can only be called from mount, and that's single threaded. XXX
+ * Mount is single-threaded, so this does not need m_sb_lock for
+ * serialization. Take it anyway to keep sb_qflags updates consistent
+ * with the runtime quota update paths.
*/
spin_lock(&mp->m_sb_lock);
sbf = mp->m_sb.sb_qflags;
base-commit: 804826eac53cff44f88f42989fcc601c2612c0ed
--
2.43.0
next reply other threads:[~2026-06-27 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 22:39 Tsu-chieh Chen [this message]
2026-06-29 10:00 ` [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas Carlos Maiolino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260627223910.129798-1-tsuchieh.chen@gmail.com \
--to=tsuchieh.chen@gmail.com \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox