[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090805151220.GB6210@localhost>
Date: Wed, 5 Aug 2009 23:12:20 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Nick Piggin <npiggin@...e.de>
Cc: Andi Kleen <andi@...stfloor.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"hidehiro.kawai.ez@...achi.com" <hidehiro.kawai.ez@...achi.com>
Subject: Re: [PATCH] [11/19] HWPOISON: Refactor truncate to allow direct
truncating of page v2
On Wed, Aug 05, 2009 at 10:01:45PM +0800, Nick Piggin wrote:
> On Wed, Aug 05, 2009 at 03:46:08PM +0200, Andi Kleen wrote:
> > On Wed, Aug 05, 2009 at 12:20:08PM +0200, Nick Piggin wrote:
> > > > truncate_complete_page(struct address_space *mapping, struct page *page)
> > > > {
> > > > if (page->mapping != mapping)
> > > > - return;
> > > > + return -EIO;
> > >
> > > Hmm, at this point, the page must have been removed from pagecache,
> > > so I don't know if you need to pass an error back?
> >
> > It could be reused, which would be bad for us?
>
> I haven't brought up the caller at this point, but IIRC you had
> the page locked and mapping confirmed at this point anyway so
> it would never be an error for your code.
Right, that 'if' will always evaluate to false for the hwpoison case.
Because that 'mapping' was taken from 'page->mapping' inside page lock
and they will just remain the same values.
> Probably it would be nice to just force callers to verify the page.
> Normally IMO it is much nicer and clearer to do it at the time the
> page gets locked, unless there is good reason otherwise.
Yes we do checked page->mapping after taking page lock.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists