Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1597956
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4.4 48/91] ext4: fix inline data error paths |
| Date | 2017-03-10 17:50 +0100 |
| Message-ID | <tjvTP-6Ev-5@gated-at.bofh.it> (permalink) |
| References | <tjoSl-1MV-3@gated-at.bofh.it> <tjtS3-5k0-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, 2017-03-10 at 10:08 +0100, Greg Kroah-Hartman wrote:
> 4.4-stable review patch. If anyone has any objections, please let me
> know.
>
> ------------------
>
> From: Theodore Ts'o <tytso@mit.edu>
>
> commit eb5efbcb762aee4b454b04f7115f73ccbcf8f0ef upstream.
>
> The write_end() function must always unlock the page and drop its ref
> count, even on an error.
This looks like a theoretical rather than a real issue, because I can't
see how ext4_write_inline_data_end() ever returns an error code.
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> fs/ext4/inline.c | 9 ++++++++-
> fs/ext4/inode.c | 20 +++++++++++++++-----
> 2 files changed, 23 insertions(+), 6 deletions(-)
>
> --- a/fs/ext4/inline.c
> +++ b/fs/ext4/inline.c
> @@ -933,8 +933,15 @@ int ext4_da_write_inline_data_end(struct
> > struct page *page)
> {
> int i_size_changed = 0;
> + int ret;
>
> - copied = ext4_write_inline_data_end(inode, pos, len, copied, page);
> + ret = ext4_write_inline_data_end(inode, pos, len, copied, page);
> + if (ret < 0) {
> + unlock_page(page);
> + put_page(page);
[...]
For 4.4 each put_page() should ideally be changed to
page_cache_release(). It makes no practical difference but would be
consistent with other paths.
Ben.
--
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.4 48/91] ext4: fix inline data error paths Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-10 15:40 +0100
Re: [PATCH 4.4 48/91] ext4: fix inline data error paths Ben Hutchings <ben@decadent.org.uk> - 2017-03-10 17:50 +0100
Re: [PATCH 4.4 48/91] ext4: fix inline data error paths Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-12 06:30 +0100
csiph-web