diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-11-23 10:35:24 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-11-26 09:33:32 -0500 |
commit | 3ef0279bb0031f67537bd8972899a6a23d3064d7 (patch) | |
tree | 9df8af1c2c32d83f84b627b74a3ccf445f4d366a | |
parent | 2f122e4f5107cf8ab0e592d63ed816a00110b4fe (diff) |
nvme-rdma: Check remotely invalidated rkey matches our expected rkey
If we got a remote invalidation on a bogus rkey, this is a protocol error.
Fail the connection in this case.
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/nvme/host/rdma.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index c03460d0ca94..3a952d458e7c 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c | |||
@@ -1334,8 +1334,13 @@ static int nvme_rdma_process_nvme_rsp(struct nvme_rdma_queue *queue, | |||
1334 | req->status = cqe->status; | 1334 | req->status = cqe->status; |
1335 | req->result = cqe->result; | 1335 | req->result = cqe->result; |
1336 | 1336 | ||
1337 | if ((wc->wc_flags & IB_WC_WITH_INVALIDATE) && | 1337 | if (wc->wc_flags & IB_WC_WITH_INVALIDATE) { |
1338 | wc->ex.invalidate_rkey == req->mr->rkey) { | 1338 | if (unlikely(wc->ex.invalidate_rkey != req->mr->rkey)) { |
1339 | dev_err(queue->ctrl->ctrl.device, | ||
1340 | "Bogus remote invalidation for rkey %#x\n", | ||
1341 | req->mr->rkey); | ||
1342 | nvme_rdma_error_recovery(queue->ctrl); | ||
1343 | } | ||
1339 | req->mr->need_inval = false; | 1344 | req->mr->need_inval = false; |
1340 | } else if (req->mr->need_inval) { | 1345 | } else if (req->mr->need_inval) { |
1341 | ret = nvme_rdma_inv_rkey(queue, req); | 1346 | ret = nvme_rdma_inv_rkey(queue, req); |