dm persistent data: fix allocation failure in space map checker init
authorMike Snitzer <snitzer@redhat.com>
Tue, 3 Jul 2012 11:55:37 +0000 (12:55 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:08 +0000 (04:32 +0100)
commit3b4a30107e053c2cd698ffc9529870eab0b4f676
tree3cef2740f05e176dd7cfb3d237ef095a58c48342
parentf8789bfd8aba0184c657648ef28b38d0b9f7282d
dm persistent data: fix allocation failure in space map checker init

commit b0239faaf87c38bb419c9264bf20817438ddc3a9 upstream.

If CONFIG_DM_DEBUG_SPACE_MAPS is enabled and memory is fragmented and a
sufficiently-large metadata device is used in a thin pool then the space
map checker will fail to allocate the memory it requires.

Switch from kmalloc to vmalloc to allow larger virtually contiguous
allocations for the space map checker's internal count arrays.

Reported-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/persistent-data/dm-space-map-checker.c