Once the 32-bit seq wraps, a newer bm_seq can look smaller than old, so .. covert to wrap-safe calculate way.
Unified · Split
| @@ -996,7 +996,7 @@ static void stripe_add_to_batch_list(struct r5conf *conf, · 995 unmodified lines | ||
| 996 | 996 | if (test_and_clear_bit(STRIPE_BIT_DELAY, &sh->state)) { |
| 997 | 997 | int seq = sh->bm_seq; |
| 998 | 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 | 1000 | seq = sh->batch_head->bm_seq; |
| 1001 | 1001 | set_bit(STRIPE_BIT_DELAY, &sh->batch_head->state); |
| 1002 | 1002 | sh->batch_head->bm_seq = seq; |