From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
jonernst07@gmx.com, Zheng Liu <wenqing.lz@taobao.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] ext4: check error return from ext4_write_inline_data_end()
Date: Mon, 24 Jun 2013 21:40:02 +0800 [thread overview]
Message-ID: <20130624134002.GB7709@gmail.com> (raw)
In-Reply-To: <1371739943-31176-1-git-send-email-tytso@mit.edu>
On Thu, Jun 20, 2013 at 10:52:23AM -0400, Theodore Ts'o wrote:
> The function ext4_write_inline_data_end() can return an error. So we
> need to assign it to a signed integer variable to check for an error
> return (since copied is an unsigned int).
>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Cc: Zheng Liu <wenqing.lz@taobao.com>
> Cc: stable@vger.kernel.org
Sorry for the late reply. Thanks for fixing this. The patch looks good
to me.
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
- Zheng
> ---
> fs/ext4/inode.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index baf5c2b..567a734 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1061,10 +1061,13 @@ static int ext4_write_end(struct file *file,
> }
> }
>
> - if (ext4_has_inline_data(inode))
> - copied = ext4_write_inline_data_end(inode, pos, len,
> - copied, page);
> - else
> + if (ext4_has_inline_data(inode)) {
> + ret = ext4_write_inline_data_end(inode, pos, len,
> + copied, page);
> + if (ret < 0)
> + goto errout;
> + copied = ret;
> + } else
> copied = block_write_end(file, mapping, pos,
> len, copied, page, fsdata);
>
> --
> 1.7.12.rc0.22.gcdd159b
>
> --
> 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:[~2013-06-24 13:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 5:44 [PATCH] ext4: deleted unnecessary assignments and useless "if" statement jon ernst
2013-06-20 14:44 ` Theodore Ts'o
2013-06-20 14:52 ` [PATCH] ext4: check error return from ext4_write_inline_data_end() Theodore Ts'o
2013-06-20 19:45 ` [PATCH -v3] ext4: delete unnecessary C statements Theodore Ts'o
2013-06-24 13:52 ` Zheng Liu
2013-06-24 13:40 ` 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=20130624134002.GB7709@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=jonernst07@gmx.com \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wenqing.lz@taobao.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.