Commit 448ec63
md/raid5: Assigning NULL to sh->batch_head before testing bit R5_Overlap of a stripe
In add_stripe_bio(), if the stripe_head is in batch list, the incoming
bio is regarded as overlapping, and the bit R5_Overlap on this stripe_head
is set. break_stripe_batch_list() checks bit R5_Overlap on each stripe_head
first then assigns NULL to sh->batch_head.
If break_stripe_batch_list() checks bit R5_Overlap on stripe_head A
after add_stripe_bio() finds stripe_head A is in batch list and before
add_stripe_bio() sets bit R5_Overlapt of stripe_head A,
break_stripe_batch_list() would not know there's a process in
wait_for_overlap and needs to call wake_up(). There's a huge chance a
process never returns from schedule() if add_stripe_bio() is called
from raid5_make_request().
In break_stripe_batch_list(), assigning NULL to sh->batch_head should
be done before it checks bit R5_Overlap of a stripe_head.
Signed-off-by: Amy Chiang <amychiang@qnap.com>
Signed-off-by: Shaohua Li <shli@fb.com>1 parent b33d106 commit 448ec63
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4620 | 4620 | | |
4621 | 4621 | | |
4622 | 4622 | | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
4623 | 4626 | | |
4624 | 4627 | | |
4625 | 4628 | | |
4626 | 4629 | | |
4627 | 4630 | | |
4628 | 4631 | | |
4629 | | - | |
4630 | | - | |
4631 | | - | |
4632 | 4632 | | |
4633 | 4633 | | |
4634 | 4634 | | |
| |||
0 commit comments