From: Carlos Maiolino <cem@kernel.org>
To: Tsu-chieh Chen <tsuchieh.chen@gmail.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: clarify sb_qflags locking in xfs_qm_mount_quotas
Date: Mon, 29 Jun 2026 12:00:30 +0200 [thread overview]
Message-ID: <akJBqrxeo9yU7_Tg@nidhogg.toxiclabs.cc> (raw)
In-Reply-To: <20260627223910.129798-1-tsuchieh.chen@gmail.com>
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
>
>
prev parent reply other threads:[~2026-06-29 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 22:39 Tsu-chieh Chen
2026-06-29 10:00 ` Carlos Maiolino [this message]
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=akJBqrxeo9yU7_Tg@nidhogg.toxiclabs.cc \
--to=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=tsuchieh.chen@gmail.com \
/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
all inboxes | Powered by JetHome®