Skip to content

Commit 1f59390

Browse files
committed
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: "Mario 'BitKoenig' Holbe" <[email protected]> Signed-off-by: NeilBrown <[email protected]>
1 parent c03f6a1 commit 1f59390

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/md/bitmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ void bitmap_destroy(mddev_t *mddev)
15901590
int bitmap_create(mddev_t *mddev)
15911591
{
15921592
struct bitmap *bitmap;
1593-
unsigned long blocks = mddev->resync_max_sectors;
1593+
sector_t blocks = mddev->resync_max_sectors;
15941594
unsigned long chunks;
15951595
unsigned long pages;
15961596
struct file *file = mddev->bitmap_file;
@@ -1632,8 +1632,8 @@ int bitmap_create(mddev_t *mddev)
16321632
bitmap->chunkshift = ffz(~bitmap->chunksize);
16331633

16341634
/* now that chunksize and chunkshift are set, we can use these macros */
1635-
chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) /
1636-
CHUNK_BLOCK_RATIO(bitmap);
1635+
chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) >>
1636+
CHUNK_BLOCK_SHIFT(bitmap);
16371637
pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
16381638

16391639
BUG_ON(!pages);

0 commit comments

Comments
 (0)