From patchwork Tue Jun 14 15:23:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 9176157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42A4D60772 for ; Tue, 14 Jun 2016 15:23:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 353C527DF9 for ; Tue, 14 Jun 2016 15:23:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29FE627E78; Tue, 14 Jun 2016 15:23:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E74292012F for ; Tue, 14 Jun 2016 15:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbcFNPXP (ORCPT ); Tue, 14 Jun 2016 11:23:15 -0400 Received: from smtp.opengridcomputing.com ([72.48.136.20]:41566 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbcFNPXP (ORCPT ); Tue, 14 Jun 2016 11:23:15 -0400 Received: from cody (cody.ogc.int [10.10.0.240]) by smtp.opengridcomputing.com (Postfix) with ESMTPS id 7848B29E70; Tue, 14 Jun 2016 10:23:14 -0500 (CDT) From: "Steve Wise" To: "'Christoph Hellwig'" Cc: "'Sagi Grimberg'" , , , "'Ming Lin'" , , , , , "'Jay Freyensee'" , "'Armen Baloyan'" References: <1465248215-18186-1-git-send-email-hch@lst.de> <1465248215-18186-5-git-send-email-hch@lst.de> <5756B75C.9000409@lightbits.io> <057a01d1c2a3$3082eec0$9188cc40$@opengridcomputing.com> <20160614143132.GA17800@infradead.org> <00ea01d1c64f$64db8880$2e929980$@opengridcomputing.com> In-Reply-To: <00ea01d1c64f$64db8880$2e929980$@opengridcomputing.com> Subject: RE: [PATCH 4/5] nvmet-rdma: add a NVMe over Fabrics RDMA target driver Date: Tue, 14 Jun 2016 10:23:17 -0500 Message-ID: <00eb01d1c650$ad232520$07696f60$@opengridcomputing.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHsnHT7Ltc2grgyk+cl8PWzIpbndQLyURyqAT0isz0BMxfF5wIiS3l0AgUbdyafZxg5kA== Content-Language: en-us Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > Either > > > nvmet should reject and destroy the cm_id, or it should do neither and > > > return non-zero to the RDMA_CM to reject/destroy. > > > > Can you just send a patch? > > Yes, I'll send it out in a separate email. Before I do, what do you think of this (untested)? --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index b1c6e5b..6f0c335 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -1255,7 +1255,8 @@ static int nvmet_rdma_cm_handler(struct rdma_cm_id *cm_id, switch (event->event) { case RDMA_CM_EVENT_CONNECT_REQUEST: - ret = nvmet_rdma_queue_connect(cm_id, event); + if (nvmet_rdma_queue_connect(cm_id, event)) + rdma_destroy_id(cm_id); break; case RDMA_CM_EVENT_ESTABLISHED: nvmet_rdma_queue_established(queue);