From: Mikulas Patocka Date: Fri, 25 Apr 2008 20:05:39 +0000 (+0000) Subject: dm snapshot: fix chunksize sector conversion X-Git-Tag: v2.6.25.1~28 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e7606a8778abd6e7458e923cfbc045382c24dd03;p=karo-tx-linux.git dm snapshot: fix chunksize sector conversion commit: 924362629bf5645aee5f49f8a0d0d5b193e65997 If a snapshot has a smaller chunksize than the page size the conversion to pages currently returns 0 instead of 1, causing: kernel BUG in mempool_resize. Signed-off-by: Mikulas Patocka Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index 5bbce29f143a..c7d305bfd838 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -131,7 +131,7 @@ struct pstore { static unsigned sectors_to_pages(unsigned sectors) { - return sectors / (PAGE_SIZE >> 9); + return DIV_ROUND_UP(sectors, PAGE_SIZE >> 9); } static int alloc_area(struct pstore *ps)