linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: tytso@mit.edu, Tao Ma <tm@tao.ma>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/4] ext4: don't keep using page if inline conversion fails
Date: Thu, 11 Sep 2014 15:17:53 +0200	[thread overview]
Message-ID: <20140911131753.GB30901@quack.suse.cz> (raw)
In-Reply-To: <20140911002845.10109.10558.stgit@birch.djwong.org>

On Wed 10-09-14 17:28:45, Darrick J. Wong wrote:
> If inline->extent conversion fails (most probably due to ENOSPC) and
> we release the temporary page that we allocated to transfer the file
> contents, don't keep using the page pointer after releasing the page.
> This occasionally leads to complaints about evicting locked pages or
> hangs when blocksize > pagesize, because it's possible for the page to
> get reallocated elsewhere in the meantime.
  Good catch! You can add:
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Cc: Tao Ma <tm@tao.ma>
> ---
>  fs/ext4/inline.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
> index bea662b..378aadf 100644
> --- a/fs/ext4/inline.c
> +++ b/fs/ext4/inline.c
> @@ -594,6 +594,7 @@ retry:
>  	if (ret) {
>  		unlock_page(page);
>  		page_cache_release(page);
> +		page = NULL;
>  		ext4_orphan_add(handle, inode);
>  		up_write(&EXT4_I(inode)->xattr_sem);
>  		sem_held = 0;
> @@ -613,7 +614,8 @@ retry:
>  	if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
>  		goto retry;
>  
> -	block_commit_write(page, from, to);
> +	if (page)
> +		block_commit_write(page, from, to);
>  out:
>  	if (page) {
>  		unlock_page(page);
> 
> --
> 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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-09-11 13:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  0:28 [PATCH 0/4] ext4/jbd2: misc 3.17 bugfixes Darrick J. Wong
2014-09-11  0:28 ` [PATCH 1/4] jbd2: fix journal checksum feature flag handling Darrick J. Wong
2014-09-11 15:47   ` Theodore Ts'o
2014-09-11  0:28 ` [PATCH 2/4] ext4: validate external journal superblock checksum Darrick J. Wong
2014-09-11 13:25   ` Jan Kara
2014-09-11 15:47     ` Theodore Ts'o
2014-09-11 17:11     ` Darrick J. Wong
2014-09-11  0:28 ` [PATCH 3/4] jbd2: restart replay without revokes if journal block csum fails Darrick J. Wong
2014-09-11 13:15   ` Jan Kara
2014-09-11 17:30     ` Darrick J. Wong
2014-09-11 17:43       ` Darrick J. Wong
2014-09-12  9:59         ` Jan Kara
2014-09-11  0:28 ` [PATCH 4/4] ext4: don't keep using page if inline conversion fails Darrick J. Wong
2014-09-11 13:17   ` Jan Kara [this message]
2014-09-11 15:46     ` Theodore Ts'o
2014-09-11 20:35 ` [PATCH 5/4] ext4: check EA value offset when loading Darrick J. Wong

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=20140911131753.GB30901@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    --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).