]> git.baikalelectronics.ru Git - kernel.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)
committerNeilBrown <neilb@suse.com>
Mon, 3 Aug 2015 07:10:56 +0000 (17:10 +1000)
commit95e86333dee36510c9de203e86f642cc4397909a
treee62f0eb74f454df5f6e219eba25ca965a591abd2
parentf7dc6c7fc8cd1a2931f9a703caf61254b4e843a4
md/raid5: don't let shrink_slab shrink too far.

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: db7042eb4271 ("md/raid5: allow the stripe_cache to grow and shrink.")
Cc: stable@vger.kernel.org (4.1 - please release with 651b8dbc17f)
Reported-by: Tomas Papan <tomas.papan@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
drivers/md/raid5.c