From mboxrd@z Thu Jan 1 00:00:00 1970 From: Namhyung Kim Subject: Re: [PATCH UPDATED] fs/buffer.c: call __block_write_begin() if we have page Date: Tue, 26 Oct 2010 17:06:34 +0900 Message-ID: <1288080394.1695.3.camel@leonhard> References: <1287848786-13347-1-git-send-email-namhyung@gmail.com> <1287850314-13663-1-git-send-email-namhyung@gmail.com> <20101025161137.5f0b642d.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Andrew Morton Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:43784 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095Ab0JZIGm (ORCPT ); Tue, 26 Oct 2010 04:06:42 -0400 In-Reply-To: <20101025161137.5f0b642d.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2010-10-25 (=EC=9B=94), 16:11 -0700, Andrew Morton: > On Sun, 24 Oct 2010 01:11:54 +0900 > Namhyung Kim wrote: >=20 > > If we have the appropriate page already, call __block_write_begin() > > directly instead of releasing and regrabbing it inside of > > block_write_begin(). > >=20 > > Signed-off-by: Namhyung Kim > > --- > > Fix error path. > >=20 > > fs/buffer.c | 12 +++++++----- > > 1 files changed, 7 insertions(+), 5 deletions(-) > >=20 > > 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 =3D NULL; > > =20 > > if (page_has_buffers(page)) { > > - unlock_page(page); > > - page_cache_release(page); > > - *pagep =3D NULL; > > - return block_write_begin(mapping, pos, len, flags, pagep, > > - get_block); > > + ret =3D __block_write_begin(page, pos, len, get_block); > > + if (unlikely(ret)) { > > + unlock_page(page); > > + page_cache_release(page); > > + *pagep =3D NULL; > > + } > > + return ret; > > } > > =20 > > if (PageMappedToDisk(page)) >=20 > It looks OK. Was it tested? (ext2 mounted with -o nobh) I just did tar && untar with current kernel source several times on UML= =2E It worked find for me. Thanks. --=20 Regards, Namhyung Kim -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html