From: NeilBrown Date: Wed, 23 May 2007 20:58:09 +0000 (-0700) Subject: md: avoid overflow in raid0 calculation with large components X-Git-Tag: v2.6.22-rc3~37 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=787f17feb204ed1c6331892fb8124b80dc9fe288;p=pandora-kernel.git 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" Signed-off-by: Neil Brown Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed