From: Sagi Grimberg Date: Tue, 20 May 2014 10:28:11 +0000 (+0300) Subject: Target/iser: Gracefully reject T10-PI enabled connect request if not supported X-Git-Tag: v3.15.3~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b50bf7e57c68316c1bda049d7b2c101ab7a8dcf;p=thirdparty%2Fkernel%2Fstable.git Target/iser: Gracefully reject T10-PI enabled connect request if not supported 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 Signed-off-by: Sagi Grimberg Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 8a776dae4e528..52c5ab872c032 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -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; }