]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
authorNeilBrown <neilb@suse.de>
Sat, 10 Sep 2011 07:21:28 +0000 (17:21 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 18:40:14 +0000 (11:40 -0700)
commit71a26cb4e0e056d88903f0df669930d2208d6755
tree0c7e5a3ba18b19fc78ec50df4dd08e9545a69013
parent97e5a85664252fd3f3f84751c7779c326df9c851
md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.

commit 27a7b260f71439c40546b43588448faac01adb93 upstream.

0.90 metadata uses an unsigned 32bit number to count the number of
kilobytes used from each device.
This should allow up to 4TB per device.
However we multiply this by 2 (to get sectors) before casting to a
larger type, so sizes above 2TB get truncated.

Also we allow rdev->sectors to be larger than 4TB, so it is possible
for the array to be resized larger than the metadata can handle.
So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
used.

Also the sanity check at the end of super_90_load should include level
1 as it used ->size too. (RAID0 and Linear don't use ->size at all).

Reported-by: Pim Zandbergen <P.Zandbergen@macroscoop.nl>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/md.c