Skip to content

Commit 5513b24

Browse files
Christoph Hellwigaxboe
authored andcommitted
ext4: use sb_bdev_nr_blocks
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Acked-by: Theodore Ts'o <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent bcc6e2c commit 5513b24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4474,7 +4474,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
44744474
goto cantfind_ext4;
44754475

44764476
/* check blocks count against device size */
4477-
blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
4477+
blocks_count = sb_bdev_nr_blocks(sb);
44784478
if (blocks_count && ext4_blocks_count(es) > blocks_count) {
44794479
ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu "
44804480
"exceeds size of device (%llu blocks)",

0 commit comments

Comments
 (0)