[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211013104343.GF19200@quack2.suse.cz>
Date: Wed, 13 Oct 2021 12:43:43 +0200
From: Jan Kara <jack@...e.cz>
To: Christoph Hellwig <hch@....de>
Cc: Jens Axboe <axboe@...nel.dk>, Coly Li <colyli@...e.de>,
Mike Snitzer <snitzer@...hat.com>, Song Liu <song@...nel.org>,
David Sterba <dsterba@...e.com>,
Josef Bacik <josef@...icpanda.com>,
Theodore Ts'o <tytso@....edu>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
Dave Kleikamp <shaggy@...nel.org>,
Ryusuke Konishi <konishi.ryusuke@...il.com>,
Anton Altaparmakov <anton@...era.com>,
Konstantin Komarov <almaz.alexandrovich@...agon-software.com>,
Kees Cook <keescook@...omium.org>,
Phillip Lougher <phillip@...ashfs.org.uk>,
Jan Kara <jack@...e.com>, linux-block@...r.kernel.org,
dm-devel@...hat.com, drbd-dev@...ts.linbit.com,
linux-bcache@...r.kernel.org, linux-raid@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-nvme@...ts.infradead.org,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-ext4@...r.kernel.org, jfs-discussion@...ts.sourceforge.net,
linux-nfs@...r.kernel.org, linux-nilfs@...r.kernel.org,
linux-ntfs-dev@...ts.sourceforge.net, ntfs3@...ts.linux.dev,
reiserfs-devel@...r.kernel.org
Subject: Re: [PATCH 21/29] reiserfs: use bdev_nr_sectors instead of open
coding it
On Wed 13-10-21 07:10:34, Christoph Hellwig wrote:
> 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 <hch@....de>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/reiserfs/super.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
> index 58481f8d63d5b..6c9681e2809f0 100644
> --- a/fs/reiserfs/super.c
> +++ b/fs/reiserfs/super.c
> @@ -1986,8 +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) <
> + if ((bdev_nr_sectors(s->s_bdev) << SECTOR_SHIFT) <
> sb_block_count(rs) * sb_blocksize(rs)) {
> SWARN(silent, s, "", "Filesystem cannot be "
> "mounted because it is bigger than the device");
> --
> 2.30.2
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists