public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Nirjhar Roy (IBM)" <nirjhar@linux.ibm.com>
Cc: hch@infradead.org, cem@kernel.org, linux-xfs@vger.kernel.org,
	ritesh.list@gmail.com, ojaswin@linux.ibm.com,
	nirjhar.roy.lists@gmail.com
Subject: Re: [PATCH v3 3/4] xfs: Update lazy counters in xfs_growfs_rt_bmblock()
Date: Thu, 19 Feb 2026 07:57:02 -0800	[thread overview]
Message-ID: <20260219155702.GH6490@frogsfrogsfrogs> (raw)
In-Reply-To: <8b7290dbe12fccd57b317562de68cf77ec670d96.1771512159.git.nirjhar.roy.lists@gmail.com>

On Thu, Feb 19, 2026 at 08:16:49PM +0530, Nirjhar Roy (IBM) wrote:
> From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
> 
> Update lazy counters in xfs_growfs_rt_bmblock() similar to the way it
> is done xfs_growfs_data_private(). This is because the lazy counters are
> not always updated and synching the counters will avoid inconsistencies
> between frexents and rtextents(total realtime extent count). This will
> be more useful once realtime shrink is implemented as this will prevent
> some transient state to occur where frexents might be greater than
> total rtextents.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>

This makes sense to me, so
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

But I have one more question: does xfs_growfs_rt_zoned need this
treatment as well?

--D

> ---
>  fs/xfs/xfs_rtalloc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index decbd07b94fd..9d451474088c 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -1047,6 +1047,15 @@ xfs_growfs_rt_bmblock(
>  	 */
>  	xfs_trans_resv_calc(mp, &mp->m_resv);
>  
> +	/*
> +	 * Sync sb counters now to reflect the updated values. Lazy counters are
> +	 * not always updated and in order to avoid inconsistencies between
> +	 * frextents and rtextents, it is better to sync the counters.
> +	 */
> +
> +	if (xfs_has_lazysbcount(mp))
> +		xfs_log_sb(args.tp);
> +
>  	error = xfs_trans_commit(args.tp);
>  	if (error)
>  		goto out_free;
> -- 
> 2.43.5
> 
> 

  reply	other threads:[~2026-02-19 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 14:46 [PATCH v3 0/4] xfs: Misc changes to XFS realtime Nirjhar Roy (IBM)
2026-02-19 14:46 ` [PATCH v3 1/4] xfs: Fix xfs_last_rt_bmblock() Nirjhar Roy (IBM)
2026-02-19 21:42   ` Darrick J. Wong
2026-02-20  6:33     ` Nirjhar Roy (IBM)
2026-02-19 14:46 ` [PATCH v3 2/4] xfs: Add a comment in xfs_log_sb() Nirjhar Roy (IBM)
2026-02-19 15:57   ` Darrick J. Wong
2026-02-19 14:46 ` [PATCH v3 3/4] xfs: Update lazy counters in xfs_growfs_rt_bmblock() Nirjhar Roy (IBM)
2026-02-19 15:57   ` Darrick J. Wong [this message]
2026-02-19 14:46 ` [PATCH v3 4/4] xfs: Add comments for usages of some macros Nirjhar Roy (IBM)
2026-02-19 15:54   ` Darrick J. Wong
2026-02-20  6:38     ` Nirjhar Roy (IBM)

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=20260219155702.GH6490@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nirjhar.roy.lists@gmail.com \
    --cc=nirjhar@linux.ibm.com \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@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