]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm snapshot: fix chunksize sector conversion
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 25 Apr 2008 20:05:39 +0000 (20:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 May 2008 21:44:33 +0000 (14:44 -0700)
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 <mpatocka@redhat.com>
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-exception-store.c

index 5bbce29f143ac45f6d358a9b26217b3d30ee1ccd..c7d305bfd838157b5bb197ebd7ffc90207151b64 100644 (file)
@@ -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)