From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 22/30] reiserfs: use bdev_nr_bytes instead of open coding it Date: Fri, 15 Oct 2021 15:26:35 +0200 Message-ID: <20211015132643.1621913-23-hch@lst.de> References: <20211015132643.1621913-1-hch@lst.de> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=JcbZRJdzKR6lA+XJCAc0x+lsN7pLEs6yrnMAqoaLruE=; b=E+Q7ZMC/0V9E6AqH5maJprLseN EStn7YautPAcC2qSZ8EhEQlOG0sJRtoOYRk4SbbnvpwSHw6kJhuePLdWLe/I2lH711tMunxMxQeUY tlLYi+8tSg+UYcNoyI4QA5lbpjZa1ZHES21GHUkBrAaAHt8kTGAUv5KeZl4YslBjuW0Fb5y+9F47L upw+EfO8q8HTACBNsFEMk6UzsM+h3YOFpIYdNrXfsVSWddqlxVWqa58RB+A+hOQUO4LkjkRPg8rEU 409fm34c5hv9iK3FJTVztLuk0jZntwNe6sR7eANz6bxxo5SAzmBsPOjl72SSJYlTWFqMJHUCmvZtU kXIJ8Qng==; In-Reply-To: <20211015132643.1621913-1-hch-jcswGhMUV9g@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: Jens Axboe Cc: Coly Li , Mike Snitzer , Song Liu , David Sterba , Josef Bacik , Theodore Ts'o , OGAWA Hirofumi , Dave Kleikamp , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Kees Cook , Phillip Lougher , Jan Kara , linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org, linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TaqPxH82wqD4g@public.gmane.org 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 Reviewed-by: Jan Kara --- fs/reiserfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 58481f8d63d5b..8647a00434ea4 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -1986,9 +1986,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) * smaller than the filesystem. If the check fails then abort and * scream, because bad stuff will happen otherwise. */ - if (s->s_bdev && s->s_bdev->bd_inode - && i_size_read(s->s_bdev->bd_inode) < - sb_block_count(rs) * sb_blocksize(rs)) { + if (bdev_nr_bytes(s->s_bdev) < sb_block_count(rs) * sb_blocksize(rs)) { SWARN(silent, s, "", "Filesystem cannot be " "mounted because it is bigger than the device"); SWARN(silent, s, "", "You may need to run fsck " -- 2.30.2