]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md: Ensure an md array never has too many devices.
authorNeilBrown <neilb@suse.de>
Fri, 6 Feb 2009 07:02:46 +0000 (18:02 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Feb 2009 17:50:24 +0000 (09:50 -0800)
commit7e451afdc1e2ce92bba911c5a9cda1728006dd2b
tree875936cc384d3c8bbd598c96fda747e63babafae
parent0e900a8736163bb7c078c815c2c96fac6106d2fd
md: Ensure an md array never has too many devices.

commit de01dfadf25bf83cfe3d85c163005c4320532658 upstream.

Each different metadata format supported by md supports a
different maximum number of devices.
We really should be enforcing this maximum in the kernel, but
we aren't quite doing that properly.

We currently only enforce it at the 'hot_add' point, which is an
older interface which is not used by current userspace.

We need to also enforce it at 'add_new_disk' time for active arrays
and at 'do_md_run' time when starting a new array.

So move the test from 'hot_add' into 'bind_rdev_to_array' which is
called from both 'hot_add' and 'add_new_disk, and add a new
test in 'analyse_sbs' which is called from 'do_md_run'.

This bug (or missing feature) has been around "forever" and so
the patch is suitable for any -stable that is currently maintained.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/md.c