]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Target/iser: Gracefully reject T10-PI enabled connect request if not supported
authorSagi Grimberg <sagig@mellanox.com>
Tue, 20 May 2014 10:28:11 +0000 (13:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:14:00 +0000 (20:14 -0700)
commit 5f80ff8eccba50832dcc640ac89add4c7fced963 upstream.

In case user chose to set T10-PI enable on the target while
the IB device does not support it, gracefully reject the request.

Reported-by: Slava Shwartsman <valyushash@gmail.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/isert/ib_isert.c

index 8a776dae4e528b1db4bffc33481508cca71bb1b6..52c5ab872c032f95e84f5c0dc2c0a59c51c62754 100644 (file)
@@ -663,8 +663,9 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 
        pi_support = np->tpg_np->tpg->tpg_attrib.t10_pi;
        if (pi_support && !device->pi_capable) {
-               pr_err("Protection information requested but not supported\n");
-               ret = -EINVAL;
+               pr_err("Protection information requested but not supported, "
+                      "rejecting connect request\n");
+               ret = rdma_reject(cma_id, NULL, 0);
                goto out_mr;
        }