]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / 0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch
CommitLineData
2cb7cef9
BS
1From 1f59390339f263c0fe7908fbe54466dbf3a64b58 Mon Sep 17 00:00:00 2001
2From: NeilBrown <neilb@suse.de>
3Date: Mon, 20 Apr 2009 11:50:24 +1000
4Subject: [PATCH] md: support bitmaps on RAID10 arrays larger then 2 terabytes
5
6.. and other arrays with components larger than 2 terabytes.
7
8We use a "long" rather than a "sector_t" in part of the bitmap
9size calculations, which is sad.
10
11Reported-by: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>
12Signed-off-by: NeilBrown <neilb@suse.de>
13---
14 drivers/md/bitmap.c | 6 +++---
15 1 file changed, 3 insertions(+), 3 deletions(-)
16
17--- a/drivers/md/bitmap.c
18+++ b/drivers/md/bitmap.c
19@@ -1587,7 +1587,7 @@ void bitmap_destroy(mddev_t *mddev)
20 int bitmap_create(mddev_t *mddev)
21 {
22 struct bitmap *bitmap;
23- unsigned long blocks = mddev->resync_max_sectors;
24+ sector_t blocks = mddev->resync_max_sectors;
25 unsigned long chunks;
26 unsigned long pages;
27 struct file *file = mddev->bitmap_file;
28@@ -1629,8 +1629,8 @@ int bitmap_create(mddev_t *mddev)
29 bitmap->chunkshift = ffz(~bitmap->chunksize);
30
31 /* now that chunksize and chunkshift are set, we can use these macros */
32- chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) /
33- CHUNK_BLOCK_RATIO(bitmap);
82094b55 34+ chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) >>
2cb7cef9
BS
35+ CHUNK_BLOCK_SHIFT(bitmap);
36 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
37
38 BUG_ON(!pages);