Skip to content

Commit

Permalink
nvmet-rdma: occasionally flush ongoing controller teardown
Browse files Browse the repository at this point in the history
If we are attacked with establishments/teradowns we need to
make sure we do not consume too much system memory. Thus
let ongoing controller teardowns complete before accepting
new controller establishments.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Sagi Grimberg authored and Jens Axboe committed Apr 4, 2017
1 parent dc2ad16 commit 777dc82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/nvme/target/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,11 @@ static int nvmet_rdma_queue_connect(struct rdma_cm_id *cm_id,
}
queue->port = cm_id->context;

if (queue->host_qid == 0) {
/* Let inflight controller teardown complete */
flush_scheduled_work();
}

ret = nvmet_rdma_cm_accept(cm_id, queue, &event->param.conn);
if (ret)
goto release_queue;
Expand Down

0 comments on commit 777dc82

Please sign in to comment.