History

md/raid5: let stripe batch bm_seq comparison wrap-safe

Once the 32-bit seq wraps, a newer bm_seq can look smaller than old, so .. covert to wrap-safe calculate way.

Chen Cheng committed 4 months ago

Commit 00e93fa1 parent 601d3c21 file · +1 −1Browse files

Unified · Split

drivers/md/raid5.c+1−1
@@ -996,7 +996,7 @@ static void stripe_add_to_batch_list(struct r5conf *conf, · 995 unmodified lines
996 if (test_and_clear_bit(STRIPE_BIT_DELAY, &sh->state)) {996 if (test_and_clear_bit(STRIPE_BIT_DELAY, &sh->state)) {
997 int seq = sh->bm_seq;997 int seq = sh->bm_seq;
998 if (test_bit(STRIPE_BIT_DELAY, &sh->batch_head->state) &&998 if (test_bit(STRIPE_BIT_DELAY, &sh->batch_head->state) &&
999 sh->batch_head->bm_seq > seq)999 sh->batch_head->bm_seq - seq > 0)
1000 seq = sh->batch_head->bm_seq;1000 seq = sh->batch_head->bm_seq;
1001 set_bit(STRIPE_BIT_DELAY, &sh->batch_head->state);1001 set_bit(STRIPE_BIT_DELAY, &sh->batch_head->state);
1002 sh->batch_head->bm_seq = seq;1002 sh->batch_head->bm_seq = seq;