When left-shifting we must be sure that the value being
shifted is large enough to not lose bits.
The 'chunkssize' in CreateBitmap is only 'long' so it
can overflow. So cast to 'long long' first.
Also fix a similar issue in Detail even though it isn't currently
being compiled.
Signed-off-by: NeilBrown <neilb@suse.de>
Reported-by: Tomasz Chmielewski <mangoo@wpkg.org>
#if 0
This is pretty boring
printf(" Reshape pos'n : %llu%s\n", (unsigned long long) info.reshape_progress<<9,
- human_size(info.reshape_progress<<9));
+ human_size((unsigned long long)info.reshape_progress<<9));
#endif
if (info.delta_disks > 0)
printf(" Delta Devices : %d, (%d->%d)\n",
*/
chunksize = DEFAULT_BITMAP_CHUNK;
/* <<20 for 2^20 chunks, >>9 to convert bytes to sectors */
- while (array_size > (chunksize << (20-9)))
+ while (array_size > ((unsigned long long)chunksize << (20-9)))
chunksize <<= 1;
}