All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>,
	linux-xfs@vger.kernel.org, "Darrick J. Wong" <djwong@kernel.org>
Subject: Re: [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range
Date: Thu, 18 Sep 2025 07:29:03 +1000	[thread overview]
Message-ID: <aMsoH2ez9ZXHjs7X@dread.disaster.area> (raw)
In-Reply-To: <20250916135235.218084-3-hch@lst.de>

On Tue, Sep 16, 2025 at 06:52:32AM -0700, Christoph Hellwig wrote:
> Only ranges inside the file system can be translated, and the file system
> can be smaller than the containing device.
> 
> Fixes: f4ed93037966 ("xfs: don't shut down the filesystem for media failures beyond end of log")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
> ---
>  fs/xfs/xfs_notify_failure.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_notify_failure.c b/fs/xfs/xfs_notify_failure.c
> index fbeddcac4792..3726caa38375 100644
> --- a/fs/xfs/xfs_notify_failure.c
> +++ b/fs/xfs/xfs_notify_failure.c
> @@ -165,7 +165,7 @@ xfs_dax_translate_range(
>  	uint64_t		*bblen)
>  {
>  	u64			dev_start = btp->bt_dax_part_off;
> -	u64			dev_len = bdev_nr_bytes(btp->bt_bdev);
> +	u64			dev_len = BBTOB(btp->bt_nr_blocks);

I'm pretty sure that's wrong based on the first patch -
btp->bt_nr_blocks is in FSB units, not BBs. If bt_nr_blocks is
converted to store the device size in BBs in the first patch like I
suggest, then it's right...

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2025-09-17 21:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-09-16 13:52 ` [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range Christoph Hellwig
2025-09-17 21:29   ` Dave Chinner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-25 11:19 store the buftarg size in the buftarg v2 Christoph Hellwig
2025-08-25 11:19 ` [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range Christoph Hellwig
2025-08-18  5:11 store the buftarg size in the buftarg Christoph Hellwig
2025-08-18  5:11 ` [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range Christoph Hellwig
2025-08-18 20:49   ` Darrick J. Wong

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=aMsoH2ez9ZXHjs7X@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=cem@kernel.org \
    --cc=djwong@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.