nvme-rdma: Don't local invalidate if the queue is not live
authorSagi Grimberg <sagi@grimberg.me>
Wed, 11 Oct 2017 12:29:10 +0000 (15:29 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 18 Oct 2017 17:27:54 +0000 (19:27 +0200)
No chance for the local invalidate to succeed if the queue-pair
is in error state. Most likely the target will do a remote
invalidation of our mr so not a big loss on the test_bit.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c

index 95837c5317b41bb3e4f8ec8a239d67197311fae4..a58dd0c77a2950c4203d92be77723671fa42be64 100644 (file)
@@ -1052,7 +1052,7 @@ static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue,
        if (!blk_rq_bytes(rq))
                return;
 
-       if (req->mr->need_inval) {
+       if (req->mr->need_inval && test_bit(NVME_RDMA_Q_LIVE, &req->queue->flags)) {
                res = nvme_rdma_inv_rkey(queue, req);
                if (unlikely(res < 0)) {
                        dev_err(ctrl->ctrl.device,