summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2013-12-21 17:56:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 12:25:16 -0800
commit2b9a704149ea2a1fe2679ffa2ed7c8d692e2b660 (patch)
tree87fbb2edc722f70d58b04345c63b5ebb04f2d35d /include
parent25c36e26d6a1021276330142f4c495235d6970de (diff)
aio/migratepages: make aio migrate pages sane
commit 8e321fefb0e60bae4e2a28d20fc4fa30758d27c6 upstream. The arbitrary restriction on page counts offered by the core migrate_page_move_mapping() code results in rather suspicious looking fiddling with page reference counts in the aio_migratepage() operation. To fix this, make migrate_page_move_mapping() take an extra_count parameter that allows aio to tell the code about its own reference count on the page being migrated. While cleaning up aio_migratepage(), make it validate that the old page being passed in is actually what aio_migratepage() expects to prevent misbehaviour in the case of races. Signed-off-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/migrate.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 804651c62296..ee8b14ae4f3f 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -55,7 +55,8 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
struct page *newpage, struct page *page);
extern int migrate_page_move_mapping(struct address_space *mapping,
struct page *newpage, struct page *page,
- struct buffer_head *head, enum migrate_mode mode);
+ struct buffer_head *head, enum migrate_mode mode,
+ int extra_count);
#else
static inline void putback_lru_pages(struct list_head *l) {}