This is a note to let you know that I've just added the patch titled MD: ignore discard request for hard disks of hybid raid1/raid10 array to the 3.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-ignore-discard-request-for-hard-disks-of-hybid-raid1-raid10-array.patch and it can be found in the queue-3.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 32f9f570d04461a41bdcd5c1d93b41ebc5ce182a Mon Sep 17 00:00:00 2001 From: Shaohua Li <shli@xxxxxxxxxx> Date: Sun, 28 Apr 2013 18:26:38 +0800 Subject: MD: ignore discard request for hard disks of hybid raid1/raid10 array From: Shaohua Li <shli@xxxxxxxxxx> commit 32f9f570d04461a41bdcd5c1d93b41ebc5ce182a upstream. In SSD/hard disk hybid storage, discard request should be ignored for hard disk. We used to be doing this way, but the unplug path forgets it. This is suitable for stable tree since v3.6. Reported-and-tested-by: Markus <M4rkusXXL@xxxxxx> Signed-off-by: Shaohua Li <shli@xxxxxxxxxxxx> Signed-off-by: NeilBrown <neilb@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/raid1.c | 7 ++++++- drivers/md/raid10.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -981,7 +981,12 @@ static void raid1_unplug(struct blk_plug while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - generic_make_request(bio); + if (unlikely((bio->bi_rw & REQ_DISCARD) && + !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) + /* Just ignore it */ + bio_endio(bio, 0); + else + generic_make_request(bio); bio = next; } kfree(plug); --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1087,7 +1087,12 @@ static void raid10_unplug(struct blk_plu while (bio) { /* submit pending writes */ struct bio *next = bio->bi_next; bio->bi_next = NULL; - generic_make_request(bio); + if (unlikely((bio->bi_rw & REQ_DISCARD) && + !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) + /* Just ignore it */ + bio_endio(bio, 0); + else + generic_make_request(bio); bio = next; } kfree(plug); Patches currently in stable-queue which might be from shli@xxxxxxxxxx are queue-3.8/md-ignore-discard-request-for-hard-disks-of-hybid-raid1-raid10-array.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html