Commit 1f59390339f263c0fe7908fbe54466dbf3a64b58

Authored by NeilBrown
1 parent c03f6a1969

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" <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: NeilBrown <neilb@suse.de>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -1590,7 +1590,7 @@
1590 1590 int bitmap_create(mddev_t *mddev)
1591 1591 {
1592 1592 struct bitmap *bitmap;
1593   - unsigned long blocks = mddev->resync_max_sectors;
  1593 + sector_t blocks = mddev->resync_max_sectors;
1594 1594 unsigned long chunks;
1595 1595 unsigned long pages;
1596 1596 struct file *file = mddev->bitmap_file;
... ... @@ -1632,8 +1632,8 @@
1632 1632 bitmap->chunkshift = ffz(~bitmap->chunksize);
1633 1633  
1634 1634 /* 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);
1637 1637 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
1638 1638  
1639 1639 BUG_ON(!pages);