NeilBrown 787f17feb2 md: avoid overflow in raid0 calculation with large components
If a raid0 has a component device larger than 4TB, and is accessed on a 32bit
machines, then as 'chunk' is unsigned long,

   chunk << chunksize_bits

can overflow (this can be as high as the size of the device in KB).  chunk
itself will not overflow (without triggering a BUG).

So change 'chunk' to be 'sector_t, and get rid of the 'BUG' as it becomes
impossible to hit.

Cc: "Jeff Zheng" <Jeff.Zheng@endace.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-23 20:14:14 -07:00
..
2007-05-08 11:15:04 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:46 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:46 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:48 -07:00
2007-05-09 12:30:46 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:46 -07:00
2006-12-08 08:29:09 -08:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:47 -07:00
2007-05-09 12:30:47 -07:00
2007-05-11 08:29:37 -07:00