]> git.baikalelectronics.ru Git - kernel.git/commit
aio/migratepages: make aio migrate pages sane
authorBenjamin LaHaise <bcrl@kvack.org>
Sat, 21 Dec 2013 22:56:08 +0000 (17:56 -0500)
committerBenjamin LaHaise <bcrl@kvack.org>
Sat, 21 Dec 2013 22:56:08 +0000 (17:56 -0500)
commitdb3c3eff7a340ce24279ff7e67f9847846fd3e55
treec00de123ad058cc2d69a2e3d59dd7a2bb7500542
parente23c35e69ac328e84454c1a3b51d495f072ed854
aio/migratepages: make aio migrate pages sane

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>
fs/aio.c
include/linux/migrate.h
mm/migrate.c