Re: [PATCH 2/2] xfs: use bt_nr_blocks in xfs_dax_translate_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 18, 2025 at 07:11:24AM +0200, 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@xxxxxx>
> ---
>  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);

Yeah, dev_len is used to filter out ranges beyond what the filesystem
cares about, so

Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>

--D

>  	u64			dev_end = dev_start + dev_len - 1;
>  
>  	/* Notify failure on the whole device. */
> -- 
> 2.47.2
> 
> 




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux