diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2008-04-24 22:41:50 +0200 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2008-04-25 14:26:34 +0200 |
commit | 924362629bf5645aee5f49f8a0d0d5b193e65997 (patch) | |
tree | 8233d321e025c0fa057ad4067ab6f4e865d74fe0 /drivers/md/dm-exception-store.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86... (diff) | |
download | linux-924362629bf5645aee5f49f8a0d0d5b193e65997.tar.xz linux-924362629bf5645aee5f49f8a0d0d5b193e65997.zip |
dm snapshot: fix chunksize sector conversion
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>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/md/dm-exception-store.c')
-rw-r--r-- | drivers/md/dm-exception-store.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |