mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas
@ 2026-06-27 22:39 Tsu-chieh Chen
  2026-06-29 10:00 ` Carlos Maiolino
  0 siblings, 1 reply; 2+ messages in thread
From: Tsu-chieh Chen @ 2026-06-27 22:39 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: linux-xfs, linux-kernel, Tsu-chieh Chen

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas
  2026-06-27 22:39 [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas Tsu-chieh Chen
@ 2026-06-29 10:00 ` Carlos Maiolino
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos Maiolino @ 2026-06-29 10:00 UTC (permalink / raw)
  To: Tsu-chieh Chen; +Cc: linux-xfs, linux-kernel

On Sat, Jun 27, 2026 at 06:39:10PM -0400, Tsu-chieh Chen wrote:
> 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.

Why? What's the actual clarification this change makes? Indeed the XXX
does not need to be there but I don't see any improvement in this change
comment-wise. XXX removal could be embedded on any other patch that
touches code around it.

>  	 */
>  	spin_lock(&mp->m_sb_lock);
>  	sbf = mp->m_sb.sb_qflags;
> 
> base-commit: 804826eac53cff44f88f42989fcc601c2612c0ed
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-29 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 22:39 [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas Tsu-chieh Chen
2026-06-29 10:00 ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®