From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: fix the zoned RT growfs check for zone alignment
Date: Mon, 15 Dec 2025 11:09:59 -0800 [thread overview]
Message-ID: <20251215190959.GH7725@frogsfrogsfrogs> (raw)
In-Reply-To: <20251215094843.537721-3-hch@lst.de>
On Mon, Dec 15, 2025 at 10:48:37AM +0100, Christoph Hellwig wrote:
> The grofs code for zoned RT subvolums already tries to check for zone
> alignment, but gets it wrong by using the old instead of the new mount
> structure.
Please add
Cc: <stable@vger.kernel.org> # v6.15
> Fixes: 01b71e64bb87 ("xfs: support growfs on zoned file systems")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks fine to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_rtalloc.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index 6907e871fa15..e063f4f2f2e6 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -1255,12 +1255,10 @@ xfs_growfs_check_rtgeom(
> min_logfsbs = min_t(xfs_extlen_t, xfs_log_calc_minimum_size(nmp),
> nmp->m_rsumblocks * 2);
>
> - kfree(nmp);
> -
> trace_xfs_growfs_check_rtgeom(mp, min_logfsbs);
>
> if (min_logfsbs > mp->m_sb.sb_logblocks)
> - return -EINVAL;
> + goto out_inval;
>
> if (xfs_has_zoned(mp)) {
> uint32_t gblocks = mp->m_groups[XG_TYPE_RTG].blocks;
> @@ -1268,16 +1266,20 @@ xfs_growfs_check_rtgeom(
>
> if (rextsize != 1)
> return -EINVAL;
> - div_u64_rem(mp->m_sb.sb_rblocks, gblocks, &rem);
> + div_u64_rem(nmp->m_sb.sb_rblocks, gblocks, &rem);
> if (rem) {
> xfs_warn(mp,
> "new RT volume size (%lld) not aligned to RT group size (%d)",
> - mp->m_sb.sb_rblocks, gblocks);
> - return -EINVAL;
> + nmp->m_sb.sb_rblocks, gblocks);
> + goto out_inval;
> }
> }
>
> + kfree(nmp);
> return 0;
> +out_inval:
> + kfree(nmp);
> + return -EINVAL;
> }
>
> /*
> --
> 2.47.3
>
>
next prev parent reply other threads:[~2025-12-15 19:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 9:48 reject non-zone aligned RT subvolumes Christoph Hellwig
2025-12-15 9:48 ` [PATCH 1/2] xfs: validate that zoned RT devices are zone aligned Christoph Hellwig
2025-12-15 19:15 ` Darrick J. Wong
2025-12-16 5:10 ` Christoph Hellwig
2025-12-16 15:59 ` Darrick J. Wong
2025-12-15 9:48 ` [PATCH 2/2] xfs: fix the zoned RT growfs check for zone alignment Christoph Hellwig
2025-12-15 19:09 ` Darrick J. Wong [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-12-16 17:30 reject non-zone aligned RT subvolumes v2 Christoph Hellwig
2025-12-16 17:30 ` [PATCH 2/2] xfs: fix the zoned RT growfs check for zone alignment Christoph Hellwig
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=20251215190959.GH7725@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=hch@lst.de \
--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