From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: [PATCH 12/17] [LogFS] readwrite.c Date: Mon, 23 Nov 2009 14:33:15 +0200 Message-ID: <84144f020911230433q5fd90321m9b463cb425fafe7d@mail.gmail.com> References: <20091120181113.GA2159@logfs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, Arnd Bergmann , Hugh Dickins , Andrew Morton To: Joern Engel Return-path: Received: from mail-fx0-f213.google.com ([209.85.220.213]:64359 "EHLO mail-fx0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757381AbZKWMdK convert rfc822-to-8bit (ORCPT ); Mon, 23 Nov 2009 07:33:10 -0500 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Joern, (Dunno who to CC, really, so lets see if I can trick Andrew or Hugh into looking at the issue.) On Fri, Nov 20, 2009 at 9:38 PM, Joern Engel wrote: > +static void logfs_lock_write_page(struct page *page) > +{ > + =A0 =A0 =A0 int loop =3D 0; > + > + =A0 =A0 =A0 while (unlikely(!trylock_page(page))) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (loop++ > 0x1000) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Has been observed on= ce so far... */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "stack = at %p\n", &loop); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BUG(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (PagePreLocked(page)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Holder of page lock = is waiting for us, it > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* is safe to use thi= s page. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Some other process has this page loc= ked and has > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* nothing to do with us. =A0Wait for= it to finish. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 schedule(); > + =A0 =A0 =A0 } > + =A0 =A0 =A0 BUG_ON(!PageLocked(page)); > +} What's the purpose of PagePreLocked()? The above function looks pretty fragile for a filesystem to me. Pekka -- 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