Commit d47648fc authored by Shaohua Li's avatar Shaohua Li Committed by NeilBrown

raid5: avoid finding "discard" stripe

SCSI discard will damage discard stripe bio setting, eg, some fields are
changed. If the stripe is reused very soon, we have wrong bios setting. We
remove discard stripe from hash list, so next time the strip will be fully

Suitable for backport to 3.7+.

Cc: <> (3.7+)
Signed-off-by: default avatarShaohua Li <>
Signed-off-by: default avatarNeilBrown <>
parent 37c61ff3
......@@ -2922,6 +2922,14 @@ static void handle_stripe_clean_event(struct r5conf *conf,
/* now that discard is done we can proceed with any sync */
clear_bit(STRIPE_DISCARD, &sh->state);
* SCSI discard will change some bio fields and the stripe has
* no updated data, so remove it from hash list and the stripe
* will be reinitialized
if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state))
set_bit(STRIPE_HANDLE, &sh->state);
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