]> www.infradead.org Git - users/jedix/linux-maple.git/commit
md/raid5: don't let shrink_slab shrink too far.
authorNeilBrown <neilb@suse.com>
Mon, 3 Aug 2015 07:09:57 +0000 (17:09 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:26:13 +0000 (19:26 +0200)
commitd7edf5fe979269233c9d20e5101ae004df05070e
tree2d5a407920335bc2719be4fb19bbd4b9c0a66c6e
parented8b312450dae5e5a9e5bc022e1261a2e6414984
md/raid5: don't let shrink_slab shrink too far.

commit 49895bcc7e566ba455eb2996607d6fbd3447ce16 upstream.

I have a report of drop_one_stripe() called from
raid5_cache_scan() apparently finding ->max_nr_stripes == 0.

This should not be allowed.

So add a test to keep max_nr_stripes above min_nr_stripes.

Also use a 'mask' rather than a 'mod' in drop_one_stripe
to ensure 'hash' is valid even if max_nr_stripes does reach zero.

Fixes: edbe83ab4c27 ("md/raid5: allow the stripe_cache to grow and shrink.")
Reported-by: Tomas Papan <tomas.papan@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid5.c