diff options
author | Shaohua Li <shli@kernel.org> | 2013-04-28 06:26:38 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-04-30 00:49:36 -0400 |
commit | 32f9f570d04461a41bdcd5c1d93b41ebc5ce182a (patch) | |
tree | 82fe7220a3d3ea346ad372f2c14bc590cf7ccb82 /drivers/md/raid10.c | |
parent | 486adf72ccc0c235754923d47a2270c5dcb0c98b (diff) |
MD: ignore discard request for hard disks of hybid raid1/raid10 array
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.
Cc: stable@vger.kernel.org
Reported-and-tested-by: Markus <M4rkusXXL@web.de>
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index c35d912a7f9b..018741ba9310 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1133,7 +1133,12 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule) | |||
1133 | while (bio) { /* submit pending writes */ | 1133 | while (bio) { /* submit pending writes */ |
1134 | struct bio *next = bio->bi_next; | 1134 | struct bio *next = bio->bi_next; |
1135 | bio->bi_next = NULL; | 1135 | bio->bi_next = NULL; |
1136 | generic_make_request(bio); | 1136 | if (unlikely((bio->bi_rw & REQ_DISCARD) && |
1137 | !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) | ||
1138 | /* Just ignore it */ | ||
1139 | bio_endio(bio, 0); | ||
1140 | else | ||
1141 | generic_make_request(bio); | ||
1137 | bio = next; | 1142 | bio = next; |
1138 | } | 1143 | } |
1139 | kfree(plug); | 1144 | kfree(plug); |