summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Cheng <chencheng@fnnas.com>2026-06-18 10:57:35 +0800
committerYu Kuai <yukuai@fygo.io>2026-06-21 05:21:07 +0800
commit00e93faf4cea9e8802ac5dfee0952d84fc95c40f (patch)
tree94ac82a130ecd614dc13bd8a98b056b780fde182
parent601d3c21b2e26b676cc67ae8804e991bbbcd4507 (diff)
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. Signed-off-by: Chen Cheng <chencheng@fnnas.com> Link: https://patch.msgid.link/20260618025735.915113-1-chencheng@fnnas.com Signed-off-by: Yu Kuai <yukuai@fygo.io>
-rw-r--r--drivers/md/raid5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 180ff0660b6a..f35c2a7b2be1 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -996,7 +996,7 @@ static void stripe_add_to_batch_list(struct r5conf *conf,
if (test_and_clear_bit(STRIPE_BIT_DELAY, &sh->state)) {
int seq = sh->bm_seq;
if (test_bit(STRIPE_BIT_DELAY, &sh->batch_head->state) &&
- sh->batch_head->bm_seq > seq)
+ sh->batch_head->bm_seq - seq > 0)
seq = sh->batch_head->bm_seq;
set_bit(STRIPE_BIT_DELAY, &sh->batch_head->state);
sh->batch_head->bm_seq = seq;