Message ID | 20190329174617.3670341-2-songliubraving@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | md fixes and improvements | expand |
On 3/29/19 11:46 AM, Song Liu wrote: > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c > index c033bfcb209e..4204a972ecf2 100644 > --- a/drivers/md/raid5.c > +++ b/drivers/md/raid5.c > @@ -4223,26 +4223,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh, > case check_state_check_result: > sh->check_state = check_state_idle; > > + if (s->failed > 1) > + break; Not sure what happened here, but there's a lot of whitespace after that if statement, and the break is using 4 spaces instead of a tab. I fixed both of these up, but please review the style of patches going forward.
> On Mar 29, 2019, at 10:51 AM, Jens Axboe <axboe@kernel.dk> wrote: > > On 3/29/19 11:46 AM, Song Liu wrote: >> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c >> index c033bfcb209e..4204a972ecf2 100644 >> --- a/drivers/md/raid5.c >> +++ b/drivers/md/raid5.c >> @@ -4223,26 +4223,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh, >> case check_state_check_result: >> sh->check_state = check_state_idle; >> >> + if (s->failed > 1) >> + break; > > Not sure what happened here, but there's a lot of whitespace after that > if statement, and the break is using 4 spaces instead of a tab. I fixed > both of these up, but please review the style of patches going forward. > > -- > Jens Axboe > Thanks Jens! I will be more careful in the future. Song
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c033bfcb209e..4204a972ecf2 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4223,26 +4223,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh, case check_state_check_result: sh->check_state = check_state_idle; + if (s->failed > 1) + break; /* handle a successful check operation, if parity is correct * we are done. Otherwise update the mismatch count and repair * parity if !MD_RECOVERY_CHECK */ if (sh->ops.zero_sum_result == 0) { - /* both parities are correct */ - if (!s->failed) - set_bit(STRIPE_INSYNC, &sh->state); - else { - /* in contrast to the raid5 case we can validate - * parity, but still have a failure to write - * back - */ - sh->check_state = check_state_compute_result; - /* Returning at this point means that we may go - * off and bring p and/or q uptodate again so - * we make sure to check zero_sum_result again - * to verify if p or q need writeback - */ - } + /* Any parity checked was correct */ + set_bit(STRIPE_INSYNC, &sh->state); } else { atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches); if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {