X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=block%2Fblk-core.c;h=25f13479f552562bc2e406f3ebed2bf150e93fe9;hb=92ea09ac451a4b2f8a7fbe24592611bc2aad7258;hp=0a00e4ecf87cae37a3d310c8dfd32869ac24c161;hpb=61317c51e2aeb63a8040e1758c65c5b09e374ac2;p=karo-tx-linux.git diff --git a/block/blk-core.c b/block/blk-core.c index 0a00e4ecf87c..25f13479f552 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -645,10 +645,12 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); if (blkcg_init_queue(q)) - goto fail_id; + goto fail_bdi; return q; +fail_bdi: + bdi_destroy(&q->backing_dev_info); fail_id: ida_simple_remove(&blk_queue_ida, q->id); fail_q: @@ -739,9 +741,17 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, q->sg_reserved_size = INT_MAX; + /* Protect q->elevator from elevator_change */ + mutex_lock(&q->sysfs_lock); + /* init elevator */ - if (elevator_init(q, NULL)) + if (elevator_init(q, NULL)) { + mutex_unlock(&q->sysfs_lock); return NULL; + } + + mutex_unlock(&q->sysfs_lock); + return q; } EXPORT_SYMBOL(blk_init_allocated_queue); @@ -1419,6 +1429,9 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio, struct request *rq; bool ret = false; + if (blk_queue_nomerges(q)) + goto out; + plug = current->plug; if (!plug) goto out; @@ -2227,6 +2240,7 @@ void blk_start_request(struct request *req) if (unlikely(blk_bidi_rq(req))) req->next_rq->resid_len = blk_rq_bytes(req->next_rq); + BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags)); blk_add_timer(req); } EXPORT_SYMBOL(blk_start_request);