Commit 1f593903 authored by NeilBrown's avatar NeilBrown

md: support bitmaps on RAID10 arrays larger then 2 terabytes

.. and other arrays with components larger than 2 terabytes.

We use a "long" rather than a "sector_t" in part of the bitmap
size calculations, which is sad.
Reported-by: default avatar"Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent c03f6a19
...@@ -1590,7 +1590,7 @@ void bitmap_destroy(mddev_t *mddev) ...@@ -1590,7 +1590,7 @@ void bitmap_destroy(mddev_t *mddev)
int bitmap_create(mddev_t *mddev) int bitmap_create(mddev_t *mddev)
{ {
struct bitmap *bitmap; struct bitmap *bitmap;
unsigned long blocks = mddev->resync_max_sectors; sector_t blocks = mddev->resync_max_sectors;
unsigned long chunks; unsigned long chunks;
unsigned long pages; unsigned long pages;
struct file *file = mddev->bitmap_file; struct file *file = mddev->bitmap_file;
...@@ -1632,8 +1632,8 @@ int bitmap_create(mddev_t *mddev) ...@@ -1632,8 +1632,8 @@ int bitmap_create(mddev_t *mddev)
bitmap->chunkshift = ffz(~bitmap->chunksize); bitmap->chunkshift = ffz(~bitmap->chunksize);
/* now that chunksize and chunkshift are set, we can use these macros */ /* now that chunksize and chunkshift are set, we can use these macros */
chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) / chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) >>
CHUNK_BLOCK_RATIO(bitmap); CHUNK_BLOCK_SHIFT(bitmap);
pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
BUG_ON(!pages); BUG_ON(!pages);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment