[PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas

From: Tsu-chieh Chen

Date: Sat Jun 27 2026 - 18:40:08 EST


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@xxxxxxxxx>
---
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