]> 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)
commitd2c341cb1699fda6b21f57ec72ca606d0697d79b
tree0ab185c18654c98a9c5151f14aed1bdfdfb750f0
parent2a6312cdb2eefa2b943f221933bc29eb0214ecb3
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: 268db0256c57 ("raid5: use flex_array for scribble data")
drivers/md/raid5.c