Skip to content

Commit 6ef2175

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: use bt_nr_sectors in xfs_dax_translate_range
Only ranges inside the file system can be translated, and the file system can be smaller than the containing device. Fixes: f4ed930 ("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>
1 parent 42852fe commit 6ef2175

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/xfs/xfs_notify_failure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ xfs_dax_translate_range(
165165
uint64_t *bblen)
166166
{
167167
u64 dev_start = btp->bt_dax_part_off;
168-
u64 dev_len = bdev_nr_bytes(btp->bt_bdev);
168+
u64 dev_len = BBTOB(btp->bt_nr_sectors);
169169
u64 dev_end = dev_start + dev_len - 1;
170170

171171
/* Notify failure on the whole device. */

0 commit comments

Comments
 (0)