dm-bht allocates pages from a page pool, then uses the virtual address most of
the time. This flip-flopped a few times and the result is that the
mempool_free call is using the virtual address instead of the page pointer that
was yielded from the page pool.
This change fixes that oversight simply with virt_to_page() call. In the
future, this should be cleaned up to just keep the page around and use
page_address() calls when the virtual address is needed.
The reason this fix is preferable for now is that it doesn't impact any of the
active use code - just device removal which only occurs in the recovery
scenario.
TEST=recovery dmsetup remove calls no longer panic()
BUG=chromium-os:7451
Change-Id: I7d7493b55f6ae8668d5e5e8dc3a347be84878afc
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/
4163004
continue;
default:
BUG_ON(!entry->nodes);
- mempool_free(entry->nodes, bht->entry_pool);
+ mempool_free(virt_to_page(entry->nodes),
+ bht->entry_pool);
break;
}
}