lkml.org 
[lkml]   [2009]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 05/43] FS-Cache: Release page->private after failed readahead [ver #46]
Date
Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> This does not release the page for which the filler function fails.

That's a good point. That page is attached to the pagecache and the LRU by
that point. I suppose the page could be removed (but someone else may be
trying to reference it by this point), or I could amend the patch text to:

The attached patch causes read_cache_pages() to release page-private
data on a page for which add_to_page_cache() fails. If the filler
function fails, then the problematic page is left attached to the
pagecache (with appropriate flags set, one presumes) and the remaining
to-be-attached pages are invalidated and discarded. This permits
pages with caching references associated with them to be cleaned up.

The invalidatepage() address space op is called (indirectly) to do the
honours.

How about that?

> I don't have a problem with this if it is significantly easier to do here
> than the caller -- it should be a slowpath.

It could be done in the caller - every caller of read_cache_pages() that might
have the pages pre-annotated. But the changes are all in the error handling
path. If read_cache_pages() doesn't see an error, these changes are not
activated.

David


\
 
 \ /
  Last update: 2009-04-02 16:23    [W:0.204 / U:5.048 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site