md/raid5: avoid oops when number of devices is reduced then increased.
authorNeilBrown <neilb@suse.de>
Wed, 16 Jun 2010 06:45:16 +0000 (16:45 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 24 Jun 2010 03:35:02 +0000 (13:35 +1000)
commite4e11e385d1e5516ac76c956d6c25e6c2fa1b8d0
tree978807084ae3136b20a12efab3720ecec861d0ff
parent049d6c1ef983c9ac43aa423dfd752071a5b0002d
md/raid5: avoid oops when number of devices is reduced then increased.

The entries in the stripe_cache maintained by raid5 are enlarged
when we increased the number of devices in the array, but not
shrunk when we reduce the number of devices.
So if entries are added after reducing the number of devices, we
much ensure to initialise the whole entry, not just the part that
is currently relevant.  Otherwise if we enlarge the array again,
we will reference uninitialised values.

As grow_buffers/shrink_buffer now want to use a count that is stored
explicity in the raid_conf, they should get it from there rather than
being passed it as a parameter.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c