Skip to content

Commit

Permalink
raid5: Use slow_path to release stripe when mddev->thread is null
Browse files Browse the repository at this point in the history
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: 773ca82
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
majianpeng authored and NeilBrown committed Nov 14, 2013
1 parent 39cf275 commit ad4068d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ad4068d

Please sign in to comment.