Skip to content

Commit 1d5dd3b

Browse files
Christoph Hellwigaxboe
authored andcommitted
reiserfs: use bdev_nr_bytes instead of open coding it
Use the proper helper to read the block device size and remove two cargo culted checks that can't be false. 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 4646198 commit 1d5dd3b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/reiserfs/super.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,9 +1986,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
19861986
* smaller than the filesystem. If the check fails then abort and
19871987
* scream, because bad stuff will happen otherwise.
19881988
*/
1989-
if (s->s_bdev && s->s_bdev->bd_inode
1990-
&& i_size_read(s->s_bdev->bd_inode) <
1991-
sb_block_count(rs) * sb_blocksize(rs)) {
1989+
if (bdev_nr_bytes(s->s_bdev) < sb_block_count(rs) * sb_blocksize(rs)) {
19921990
SWARN(silent, s, "", "Filesystem cannot be "
19931991
"mounted because it is bigger than the device");
19941992
SWARN(silent, s, "", "You may need to run fsck "

0 commit comments

Comments
 (0)