Commit b0c783b3 authored by NeilBrown's avatar NeilBrown

md/raid5: more incorrect BUG_ON in handle_stripe_fill.

It is not incorrect to call handle_stripe_fill() when
a batch of full-stripe writes is active.
It is, however, a BUG if fetch_block() then decides
it needs to actually fetch anything.

So move the 'BUG_ON' to where it belongs.
Signed-off-by: default avatarNeilBrown  <neilb@suse.de>
Fixes: 59fc630b ("RAID5: batch adjacent full stripe write")
parent f18c1a35
...@@ -3302,6 +3302,7 @@ static int fetch_block(struct stripe_head *sh, struct stripe_head_state *s, ...@@ -3302,6 +3302,7 @@ static int fetch_block(struct stripe_head *sh, struct stripe_head_state *s,
*/ */
BUG_ON(test_bit(R5_Wantcompute, &dev->flags)); BUG_ON(test_bit(R5_Wantcompute, &dev->flags));
BUG_ON(test_bit(R5_Wantread, &dev->flags)); BUG_ON(test_bit(R5_Wantread, &dev->flags));
BUG_ON(sh->batch_head);
if ((s->uptodate == disks - 1) && if ((s->uptodate == disks - 1) &&
(s->failed && (disk_idx == s->failed_num[0] || (s->failed && (disk_idx == s->failed_num[0] ||
disk_idx == s->failed_num[1]))) { disk_idx == s->failed_num[1]))) {
...@@ -3370,7 +3371,6 @@ static void handle_stripe_fill(struct stripe_head *sh, ...@@ -3370,7 +3371,6 @@ static void handle_stripe_fill(struct stripe_head *sh,
{ {
int i; int i;
BUG_ON(sh->batch_head);
/* look for blocks to read/compute, skip this if a compute /* look for blocks to read/compute, skip this if a compute
* is already in flight, or if the stripe contents are in the * is already in flight, or if the stripe contents are in the
* midst of changing due to a write * midst of changing due to a write
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment