]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: fix allocation of 'scribble' array.
authorNeilBrown <neilb@suse.de>
Fri, 8 May 2015 08:19:39 +0000 (18:19 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 8 May 2015 08:47:48 +0000 (18:47 +1000)
commitcad01867fccc96bc8779a19830de3e5c0e44a946
tree0ab185c18654c98a9c5151f14aed1bdfdfb750f0
parent347939e1d83ba78067d9dff3af9d10391ca4db00
md/raid5: fix allocation of 'scribble' array.

As the new 'scribble' array is sized based on chunk size,
we need to make sure the size matches the largest of 'old'
and 'new' chunk sizes when the array is undergoing reshape.

We also potentially need to resize it even when not resizing
the stripe cache, as chunk size can change without changing
number of devices.

So move the 'resize' code into a separate function, and
consider old and new sizes when allocating.

Signed-off-by: NeilBrown <neilb@suse.de>
Fixes: 24d678869c35 ("raid5: use flex_array for scribble data")
drivers/md/raid5.c