linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH UPDATED] fs/buffer.c: call __block_write_begin() if we have page
Date: Mon, 25 Oct 2010 16:11:37 -0700	[thread overview]
Message-ID: <20101025161137.5f0b642d.akpm@linux-foundation.org> (raw)
In-Reply-To: <1287850314-13663-1-git-send-email-namhyung@gmail.com>

On Sun, 24 Oct 2010 01:11:54 +0900
Namhyung Kim <namhyung@gmail.com> wrote:

> If we have the appropriate page already, call __block_write_begin()
> directly instead of releasing and regrabbing it inside of
> block_write_begin().
> 
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
> Fix error path.
> 
>  fs/buffer.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 7f0b9b0..f5755f7 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2466,11 +2466,13 @@ int nobh_write_begin(struct address_space *mapping,
>  	*fsdata = NULL;
>  
>  	if (page_has_buffers(page)) {
> -		unlock_page(page);
> -		page_cache_release(page);
> -		*pagep = NULL;
> -		return block_write_begin(mapping, pos, len, flags, pagep,
> -					 get_block);
> +		ret = __block_write_begin(page, pos, len, get_block);
> +		if (unlikely(ret)) {
> +			unlock_page(page);
> +			page_cache_release(page);
> +			*pagep = NULL;
> +		}
> +		return ret;
>  	}
>  
>  	if (PageMappedToDisk(page))

It looks OK.  Was it tested?  (ext2 mounted with -o nobh)

  parent reply	other threads:[~2010-10-25 23:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23 15:46 [PATCH] fs/buffer.c: call __block_write_begin() if we have page Namhyung Kim
2010-10-23 16:11 ` [PATCH UPDATED] " Namhyung Kim
2010-10-25  6:01   ` [PATCH RESEND] " Namhyung Kim
2010-10-25 23:11   ` Andrew Morton [this message]
2010-10-26  8:06     ` [PATCH UPDATED] " Namhyung Kim

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=20101025161137.5f0b642d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).