]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.25.1/dm-snapshot-fix-chunksize-sector-conversion.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.25.1 / dm-snapshot-fix-chunksize-sector-conversion.patch
1 From stable-bounces@linux.kernel.org Fri Apr 25 13:47:58 2008
2 From: Mikulas Patocka <mpatocka@redhat.com>
3 Date: Fri, 25 Apr 2008 20:05:39 GMT
4 Subject: dm snapshot: fix chunksize sector conversion
5 To: jejb@kernel.org, stable@kernel.org
6 Message-ID: <200804252005.m3PK5dXs013576@hera.kernel.org>
7
8 From: Mikulas Patocka <mpatocka@redhat.com>
9
10 commit: 924362629bf5645aee5f49f8a0d0d5b193e65997
11
12 If a snapshot has a smaller chunksize than the page size the
13 conversion to pages currently returns 0 instead of 1, causing:
14 kernel BUG in mempool_resize.
15
16 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
17 Signed-off-by: Milan Broz <mbroz@redhat.com>
18 Signed-off-by: Alasdair G Kergon <agk@redhat.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21 ---
22 drivers/md/dm-exception-store.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 --- a/drivers/md/dm-exception-store.c
26 +++ b/drivers/md/dm-exception-store.c
27 @@ -131,7 +131,7 @@ struct pstore {
28
29 static unsigned sectors_to_pages(unsigned sectors)
30 {
31 - return sectors / (PAGE_SIZE >> 9);
32 + return DIV_ROUND_UP(sectors, PAGE_SIZE >> 9);
33 }
34
35 static int alloc_area(struct pstore *ps)