]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: fix a recently broken BUG_ON().
authorNeilBrown <neilb@suse.de>
Tue, 14 Jan 2014 04:16:10 +0000 (15:16 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 14 Jan 2014 05:44:07 +0000 (16:44 +1100)
commit6b3c9ee6982d351d8532b45717c46723460add0a
treed2572106b3e41964a96dbf0fe71f4c22e486802d
parent219b1a06389bc2adfe0ae893da989ecab7a460a3
md/raid5: fix a recently broken BUG_ON().

commit b03b7d5e865496d8e194112ca1e898b57d779943
    md/raid5: fix newly-broken locking in get_active_stripe.

simplified a BUG_ON, but removed too much so now it sometimes fires
when it shouldn't.

When the STRIPE_EXPANDING flag is set, the stripe_head might be on a
special list while multiple stripe_heads are collected, or it might
not be on any list, even a 'free' list when the refcount is zero.  As
long as STRIPE_EXPANDING is set, it will be found and added back to a
list eventually.

So both of the BUG_ONs which test for the ->lru being empty or not
need to avoid the case where STRIPE_EXPANDING is set.

The patch which broke this was marked for -stable, so this patch needs
to be applied to any branch that received b03b7d5e

Fixes: b03b7d5e865496d8e194112ca1e898b57d779943
Cc: stable@vger.kernel.org (any release to which above was applied)
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c