|
@@ -811,6 +811,14 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh
|
|
|
spin_unlock(&head->batch_head->batch_lock);
|
|
|
goto unlock_out;
|
|
|
}
|
|
|
+ /*
|
|
|
+ * We must assign batch_head of this stripe within the
|
|
|
+ * batch_lock, otherwise clear_batch_ready of batch head
|
|
|
+ * stripe could clear BATCH_READY bit of this stripe and
|
|
|
+ * this stripe->batch_head doesn't get assigned, which
|
|
|
+ * could confuse clear_batch_ready for this stripe
|
|
|
+ */
|
|
|
+ sh->batch_head = head->batch_head;
|
|
|
|
|
|
/*
|
|
|
* at this point, head's BATCH_READY could be cleared, but we
|
|
@@ -818,8 +826,6 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh
|
|
|
*/
|
|
|
list_add(&sh->batch_list, &head->batch_list);
|
|
|
spin_unlock(&head->batch_head->batch_lock);
|
|
|
-
|
|
|
- sh->batch_head = head->batch_head;
|
|
|
} else {
|
|
|
head->batch_head = head;
|
|
|
sh->batch_head = head->batch_head;
|