From: Theodore Ts'o <tytso@mit.edu>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1 linux-next] ext4: atomically read inode size
Date: Mon, 23 Jan 2017 13:26:11 -0500 [thread overview]
Message-ID: <20170123182611.xvgouds4ug7cgps5@thunk.org> (raw)
In-Reply-To: <20170123175609.6032-1-fabf@skynet.be>
On Mon, Jan 23, 2017 at 06:56:09PM +0100, Fabian Frederick wrote:
> See i_size_read() comments in include/linux/fs.h
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/ext4/super.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 9d15a62..3746f77 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3798,7 +3798,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
> goto cantfind_ext4;
>
> /* check blocks count against device size */
> - blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
> + blocks_count = i_size_read(sb->s_bdev->bd_inode) >>
> + sb->s_blocksize_bits;
> if (blocks_count && ext4_blocks_count(es) > blocks_count) {
> ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu "
> "exceeds size of device (%llu blocks)",
Um, this is at mount time, and we're talking about the i_size of the
block device --- which typically isn't moving around a huge amount.
- Ted
prev parent reply other threads:[~2017-01-23 18:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-23 17:56 [PATCH 1/1 linux-next] ext4: atomically read inode size Fabian Frederick
2017-01-23 18:26 ` Theodore Ts'o [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170123182611.xvgouds4ug7cgps5@thunk.org \
--to=tytso@mit.edu \
--cc=fabf@skynet.be \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox