diff options
-rw-r--r-- | block/blk-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 5ab3ac22930c..7da630e25ae7 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1644,6 +1644,9 @@ EXPORT_SYMBOL(submit_bio); | |||
1644 | */ | 1644 | */ |
1645 | int blk_rq_check_limits(struct request_queue *q, struct request *rq) | 1645 | int blk_rq_check_limits(struct request_queue *q, struct request *rq) |
1646 | { | 1646 | { |
1647 | if (rq->cmd_flags & REQ_DISCARD) | ||
1648 | return 0; | ||
1649 | |||
1647 | if (blk_rq_sectors(rq) > queue_max_sectors(q) || | 1650 | if (blk_rq_sectors(rq) > queue_max_sectors(q) || |
1648 | blk_rq_bytes(rq) > queue_max_hw_sectors(q) << 9) { | 1651 | blk_rq_bytes(rq) > queue_max_hw_sectors(q) << 9) { |
1649 | printk(KERN_ERR "%s: over max size limit.\n", __func__); | 1652 | printk(KERN_ERR "%s: over max size limit.\n", __func__); |
@@ -2492,6 +2495,8 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) | |||
2492 | { | 2495 | { |
2493 | dst->cpu = src->cpu; | 2496 | dst->cpu = src->cpu; |
2494 | dst->cmd_flags = (rq_data_dir(src) | REQ_NOMERGE); | 2497 | dst->cmd_flags = (rq_data_dir(src) | REQ_NOMERGE); |
2498 | if (src->cmd_flags & REQ_DISCARD) | ||
2499 | dst->cmd_flags |= REQ_DISCARD; | ||
2495 | dst->cmd_type = src->cmd_type; | 2500 | dst->cmd_type = src->cmd_type; |
2496 | dst->__sector = blk_rq_pos(src); | 2501 | dst->__sector = blk_rq_pos(src); |
2497 | dst->__data_len = blk_rq_bytes(src); | 2502 | dst->__data_len = blk_rq_bytes(src); |