]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
authorNeilBrown <neilb@suse.de>
Thu, 8 Sep 2011 01:13:53 +0000 (11:13 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 8 Sep 2011 01:13:53 +0000 (11:13 +1000)
commite8d3abdd50e2a8adc896b5b8691857fc2a02b3ce
treeea09a0dda87851d4aa5b33d8dfe13505833c93dc
parent7485fc1e485b3dca113373ca86155a61eb2982c8
md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.

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>
drivers/md/md.c