]> git.karo-electronics.de Git - linux-beck.git/commitdiff
nvmet-rdma: Fix REJ status code
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 18 Oct 2016 19:59:47 +0000 (12:59 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Tue, 6 Dec 2016 08:17:03 +0000 (10:17 +0200)
nvmet_sq_init() returns a value <= 0. nvmet_rdma_cm_reject() expects
a second argument that is a NVME_RDMA_CM_* constant. Hence this patch.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Sagi Grimberg <sagi@grimbeg.me>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/target/rdma.c

index f8d23999e0f2c28b98934c6a790b3a6c2bde26d1..35b97a898ecd71e1624bfd3378a89f48be828c89 100644 (file)
@@ -1044,8 +1044,10 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev,
        }
 
        ret = nvmet_sq_init(&queue->nvme_sq);
-       if (ret)
+       if (ret) {
+               ret = NVME_RDMA_CM_NO_RSC;
                goto out_free_queue;
+       }
 
        ret = nvmet_rdma_parse_cm_connect_req(&event->param.conn, queue);
        if (ret)
@@ -1114,6 +1116,7 @@ out_destroy_sq:
 out_free_queue:
        kfree(queue);
 out_reject:
+       pr_debug("rejecting connect request with status code %d\n", ret);
        nvmet_rdma_cm_reject(cm_id, ret);
        return NULL;
 }