From: Mikulas Patocka <[email-masked]>

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 <[email-masked]>
Signed-off-by: Milan Broz <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>
Cc: [email-masked]
---
 drivers/md/dm-exception-store.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.25/drivers/md/dm-exception-store.c
===================================================================
--- linux-2.6.25.orig/drivers/md/dm-exception-store.c	2008-04-24 17:43:47.000000000 +0100
+++ linux-2.6.25/drivers/md/dm-exception-store.c	2008-04-24 18:00:16.000000000 +0100
@@ -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)