]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit80e6700f870025deb60e2d611eed7e4c045bc727
tree978807084ae3136b20a12efab3720ecec861d0ff
parent314faebb6dcd0ef7283b0e252da3ee8adc81ab8c
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