aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-linear.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r--drivers/md/dm-linear.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 679b4c0a2eea..66ba16713f69 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -135,8 +135,7 @@ static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev
/*
* Only pass ioctls through if the device sizes match exactly.
*/
- if (lc->start ||
- ti->len != i_size_read(dev->bdev->bd_inode) >> SECTOR_SHIFT)
+ if (lc->start || ti->len != bdev_nr_sectors(dev->bdev))
return 1;
return 0;
}