aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaohua Li <shli@kernel.org>2013-10-19 02:51:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-12 22:05:31 -0500
commit01e608d7276508fcafb76f2092db89885e62ef66 (patch)
tree150dd95f42dfdc7e34db77cb50513ea5b7f26edb
parent7e44a92662ce582268c4f35e68aad1f632ada8f8 (diff)
raid5: avoid finding "discard" stripe
commit d47648fcf0611812286f68131b40251c6fa54f5e upstream. 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 initialized. Suitable for backport to 3.7+. Signed-off-by: Shaohua Li <shli@fusionio.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/raid5.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 279dd99bd4c8..4bed5454b8dc 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2812,6 +2812,14 @@ static void handle_stripe_clean_event(struct r5conf *conf,
2812 } 2812 }
2813 /* now that discard is done we can proceed with any sync */ 2813 /* now that discard is done we can proceed with any sync */
2814 clear_bit(STRIPE_DISCARD, &sh->state); 2814 clear_bit(STRIPE_DISCARD, &sh->state);
2815 /*
2816 * SCSI discard will change some bio fields and the stripe has
2817 * no updated data, so remove it from hash list and the stripe
2818 * will be reinitialized
2819 */
2820 spin_lock_irq(&conf->device_lock);
2821 remove_hash(sh);
2822 spin_unlock_irq(&conf->device_lock);
2815 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) 2823 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state))
2816 set_bit(STRIPE_HANDLE, &sh->state); 2824 set_bit(STRIPE_HANDLE, &sh->state);
2817 2825