summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2013-11-14 15:16:15 +1100
committerNeilBrown <neilb@suse.de>2013-11-14 15:16:15 +1100
commitad4068de49862b083ac2a15bc50689bb30ce3e44 (patch)
tree83b871b13fa3b1cc3bf6b6b2b2527be354ae7768 /drivers
parent39cf275a1a18ba3c7eb9b986c5c9b35b57332798 (diff)
raid5: Use slow_path to release stripe when mddev->thread is null
When release_stripe() is called in grow_one_stripe(), the mddev->thread is null. So it will omit one wakeup this thread to release stripe. For this condition, use slow_path to release stripe. Bug was introduced in 3.12 Cc: stable@vger.kernel.org (3.12+) Fixes: 773ca82fa1ee58dd1bf88b Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid5.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f8b906843926..f013d3662665 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -340,7 +340,8 @@ static void release_stripe(struct stripe_head *sh)
unsigned long flags;
bool wakeup;
- if (test_and_set_bit(STRIPE_ON_RELEASE_LIST, &sh->state))
+ if (unlikely(!conf->mddev->thread) ||
+ test_and_set_bit(STRIPE_ON_RELEASE_LIST, &sh->state))
goto slow_path;
wakeup = llist_add(&sh->release_list, &conf->released_stripes);
if (wakeup)