diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-03-21 15:29:49 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-04 17:48:23 +0200 |
commit | 777dc82395de6e04b3a5fedcf153eb99bf5f1241 (patch) | |
tree | 6b05969ca0cde280547b51b337ea06b5da7fc26e /drivers/nvme/target | |
parent | nvme-rdma: handle cpu unplug when re-establishing the controller (diff) | |
download | linux-777dc82395de6e04b3a5fedcf153eb99bf5f1241.tar.xz linux-777dc82395de6e04b3a5fedcf153eb99bf5f1241.zip |
nvmet-rdma: occasionally flush ongoing controller teardown
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>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r-- | drivers/nvme/target/rdma.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index ecc4fe862561..88bb5814c264 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -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; |