mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] fuse: fix error case in fuse_readpages
Don't let fuse_readpages leave the @pages list not empty when exiting on error. [[email protected]: kernel-doc fixes] Signed-off-by: Alexander Zarochentsev <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9b41ea7289
commit
1d7ea7324a
3 changed files with 29 additions and 2 deletions
20
mm/swap.c
20
mm/swap.c
|
|
@ -54,6 +54,26 @@ void put_page(struct page *page)
|
|||
}
|
||||
EXPORT_SYMBOL(put_page);
|
||||
|
||||
/**
|
||||
* put_pages_list(): release a list of pages
|
||||
*
|
||||
* Release a list of pages which are strung together on page.lru. Currently
|
||||
* used by read_cache_pages() and related error recovery code.
|
||||
*
|
||||
* @pages: list of pages threaded on page->lru
|
||||
*/
|
||||
void put_pages_list(struct list_head *pages)
|
||||
{
|
||||
while (!list_empty(pages)) {
|
||||
struct page *victim;
|
||||
|
||||
victim = list_entry(pages->prev, struct page, lru);
|
||||
list_del(&victim->lru);
|
||||
page_cache_release(victim);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(put_pages_list);
|
||||
|
||||
/*
|
||||
* Writeback is about to end against a page which has been marked for immediate
|
||||
* reclaim. If it still appears to be reclaimable, move it to the tail of the
|
||||
|
|
|
|||
Loading…
Reference in a new issue