md: Fix md grow/size code to correctly find the maximum available space
commit75ba82c65d55099a0af5aba1075f8bdcaf566b56
authorNeil Brown <neilb@suse.de>
Fri, 15 Dec 2006 00:48:58 +0000 (15 01:48 +0100)
committerAdrian Bunk <bunk@stusta.de>
Fri, 15 Dec 2006 00:48:58 +0000 (15 01:48 +0100)
tree0771aa37ad875067eecf8157c5b4fe8099c74b3a
parente89da8fc50c416abf4abab77d851e051df0edbec
md: Fix md grow/size code to correctly find the maximum available space

An md array can be asked to change the amount of each device that it is using,
and in particular can be asked to use the maximum available space.  This
currently only works if the first device is not larger than the rest.  As
'size' gets changed and so 'fit' becomes wrong.  So check if a 'fit' is
required early and don't corrupt it.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/md/md.c