]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfs: use bt_nr_sectors in xfs_dax_translate_range
authorChristoph Hellwig <hch@lst.de>
Fri, 19 Sep 2025 13:12:09 +0000 (06:12 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 22 Sep 2025 10:55:20 +0000 (12:55 +0200)
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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_notify_failure.c

index fbeddcac47920899509288cba15f10fcc2085e26..b1767288994206b35eb1276d3e0cfcd823c29c55 100644 (file)
@@ -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_sectors);
        u64                     dev_end = dev_start + dev_len - 1;
 
        /* Notify failure on the whole device. */