From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: track the number of blocks in each buftarg
Date: Tue, 26 Aug 2025 15:42:48 +1000 [thread overview]
Message-ID: <aK1JWBw72zzC1uvN@dread.disaster.area> (raw)
In-Reply-To: <20250825111944.460955-2-hch@lst.de>
On Mon, Aug 25, 2025 at 01:19:35PM +0200, Christoph Hellwig wrote:
> Add a bt_nr_blocks to track the number of blocks in each buftarg, and
> replace the check that hard codes sb_dblock in xfs_buf_map_verify with
> this new value so that it is correct for non-ddev buftargs. The
> RT buftarg only has a superblock in the first block, so it is unlikely
> to trigger this, or are we likely to ever have enough blocks in the
> in-memory buftargs, but we might as well get the check right.
>
> Fixes: 10616b806d1d ("xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/xfs_buf.c | 38 +++++++++++++++++++----------------
> fs/xfs/xfs_buf.h | 4 +++-
> fs/xfs/xfs_buf_item_recover.c | 7 +++++++
> fs/xfs/xfs_super.c | 7 ++++---
> fs/xfs/xfs_trans.c | 21 +++++++++----------
> 5 files changed, 45 insertions(+), 32 deletions(-)
....
> diff --git a/fs/xfs/xfs_buf_item_recover.c b/fs/xfs/xfs_buf_item_recover.c
> index 5d58e2ae4972..d43234e04174 100644
> --- a/fs/xfs/xfs_buf_item_recover.c
> +++ b/fs/xfs/xfs_buf_item_recover.c
> @@ -736,6 +736,13 @@ xlog_recover_do_primary_sb_buffer(
> */
> xfs_sb_from_disk(&mp->m_sb, dsb);
>
> + /*
> + * Grow can change the device size. Mirror that into the buftarg.
> + */
> + mp->m_ddev_targp->bt_nr_blocks = mp->m_sb.sb_dblocks;
> + if (mp->m_rtdev_targp && mp->m_rtdev_targp != mp->m_ddev_targp)
> + mp->m_rtdev_targp->bt_nr_blocks = mp->m_sb.sb_dblocks;
^
That's not right.
Perhaps we need some growfs crash/recovery tests to exercise this
code....
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2025-08-26 5:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 11:19 store the buftarg size in the buftarg v2 Christoph Hellwig
2025-08-25 11:19 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-08-25 15:26 ` Darrick J. Wong
2025-08-26 13:28 ` Christoph Hellwig
2025-08-26 5:42 ` Dave Chinner [this message]
2025-08-26 13:29 ` Christoph Hellwig
2025-08-25 11:19 ` [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2025-09-19 13:12 store the buftarg size in the buftarg v4 Christoph Hellwig
2025-09-19 13:12 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-09-19 17:52 ` Darrick J. Wong
2025-10-13 5:46 ` Darrick J. Wong
2025-10-13 6:29 ` Christoph Hellwig
2025-10-13 14:54 ` Darrick J. Wong
2025-09-16 13:52 store the buftarg size in the buftarg v3 Christoph Hellwig
2025-09-16 13:52 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-09-17 21:26 ` Dave Chinner
2025-08-18 5:11 store the buftarg size in the buftarg Christoph Hellwig
2025-08-18 5:11 ` [PATCH 1/2] xfs: track the number of blocks in each buftarg Christoph Hellwig
2025-08-18 20:48 ` Darrick J. Wong
2025-08-19 8:06 ` 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=aK1JWBw72zzC1uvN@dread.disaster.area \
--to=david@fromorbit.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.