From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] ext4: use i_size_read in ext4_unaligned_aio()
Date: Sun, 13 Apr 2014 16:10:06 +0800 [thread overview]
Message-ID: <20140413081005.GA3041@gmail.com> (raw)
In-Reply-To: <1397321174-7605-1-git-send-email-tytso@mit.edu>
On Sat, Apr 12, 2014 at 12:46:14PM -0400, Theodore Ts'o wrote:
> We haven't taken i_mutex yet, so we need to use i_size_read().
>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Cc: stable@vger.kernel.org
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
- Zheng
> ---
> fs/ext4/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 6db7f7d..bc76559 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -82,7 +82,7 @@ ext4_unaligned_aio(struct inode *inode, const struct iovec *iov,
> size_t count = iov_length(iov, nr_segs);
> loff_t final_size = pos + count;
>
> - if (pos >= inode->i_size)
> + if (pos >= i_size_read(inode))
> return 0;
>
> if ((pos & blockmask) || (final_size & blockmask))
> --
> 1.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-04-13 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-12 16:46 [PATCH] ext4: use i_size_read in ext4_unaligned_aio() Theodore Ts'o
2014-04-13 8:10 ` Zheng Liu [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=20140413081005.GA3041@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).