[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <32302.1543671386@warthog.procyon.org.uk>
Date: Sat, 01 Dec 2018 13:36:26 +0000
From: David Howells <dhowells@...hat.com>
To: Daniel Axtens <dja@...ens.net>
Cc: dhowells@...hat.com, torvalds@...ux-foundation.org,
Shantanu Goel <sgoel01@...oo.com>,
Kiran Kumar Modukuri <kiran.modukuri@...il.com>,
linux-cachefs@...hat.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/7] cachefiles: Fix page leak in cachefiles_read_backing_file while vmscan is active
Daniel Axtens <dja@...ens.net> wrote:
> > [dhowells: Note that I've removed the clearance and put of newpage as
> > they aren't attested in the commit message and don't appear to actually
> > achieve anything since a new page is only allocated is newpage!=NULL and
> > any residual new page is cleared before returning.]
>
> Sorry I hadn't got back to you on this; I think we also discussed this
> with the Ubuntu kernel team and concluded - as you did - that these
> didn't fix any bugs but did make things seem more consistent.
The idea is that if it fails to use the new page it caches it for the next
iteration of the loop rather than going to the allocator twice. But making
the change you proposed, you should also remove the bit that discards the page
on the way out of the function and probably shouldn't initialise newpage at
the top of the function so that the compiler will let you know about paths
that don't handle it.
David
Powered by blists - more mailing lists