diff --git a/block/ssg-iosched.c b/block/ssg-iosched.c index 4cb3b58cf..ee3d56823 100755 --- a/block/ssg-iosched.c +++ b/block/ssg-iosched.c @@ -674,6 +674,7 @@ static void ssg_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, struct request_queue *q = hctx->queue; struct ssg_data *ssg = q->elevator->elevator_data; const int data_dir = rq_data_dir(rq); + LIST_HEAD(free); /* * This may be a requeue of a write request that has locked its @@ -681,8 +682,10 @@ static void ssg_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, */ blk_req_zone_write_unlock(rq); - if (blk_mq_sched_try_insert_merge(q, rq)) + if (blk_mq_sched_try_insert_merge(q, rq, &free)) { + blk_mq_free_requests(&free); return; + } blk_mq_sched_request_inserted(rq);