From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>, Sagi Grimberg <sagig@mellanox.com>,
Sebastian Parschauer <sebastian.riemer@profitbricks.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Robert Elliott <Elliott@hp.com>,
Ming Lei <ming.lei@canonical.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
linux-rdma <linux-rdma@vger.kernel.org>
Subject: [PATCH v3 04/11] IB/srp: Move ib_destroy_cm_id() call into srp_free_ch_ib()
Date: Thu, 30 Oct 2014 14:46:27 +0100 [thread overview]
Message-ID: <54524133.2060604@acm.org> (raw)
In-Reply-To: <545240AE.6060009@acm.org>
The patch that adds multichannel support into the SRP initiator
driver introduces an additional call to srp_free_ch_ib(). This
patch helps to keep that later patch simple.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
---
drivers/infiniband/ulp/srp/ib_srp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 62d2a18..d3c712f 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -555,6 +555,11 @@ static void srp_free_target_ib(struct srp_target_port *target)
struct srp_device *dev = target->srp_host->srp_dev;
int i;
+ if (target->cm_id) {
+ ib_destroy_cm_id(target->cm_id);
+ target->cm_id = NULL;
+ }
+
if (dev->use_fast_reg) {
if (target->fr_pool)
srp_destroy_fr_pool(target->fr_pool);
@@ -868,7 +873,6 @@ static void srp_remove_target(struct srp_target_port *target)
scsi_remove_host(target->scsi_host);
srp_stop_rport_timers(target->rport);
srp_disconnect_target(target);
- ib_destroy_cm_id(target->cm_id);
srp_free_target_ib(target);
cancel_work_sync(&target->tl_err_work);
srp_rport_put(target->rport);
@@ -3043,7 +3047,7 @@ static ssize_t srp_create_target(struct device *dev,
if (ret) {
shost_printk(KERN_ERR, target->scsi_host,
PFX "Connection failed\n");
- goto err_cm_id;
+ goto err_free_ib;
}
ret = srp_add_target(host, target);
@@ -3067,9 +3071,6 @@ out:
err_disconnect:
srp_disconnect_target(target);
-err_cm_id:
- ib_destroy_cm_id(target->cm_id);
-
err_free_ib:
srp_free_target_ib(target);
--
1.8.4.5
next prev parent reply other threads:[~2014-10-30 13:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 13:44 [PATCH v3 0/11] IB/srp: Add multichannel support Bart Van Assche
2014-10-30 13:45 ` [PATCH v3 02/11] scsi-mq: Add support for multiple hardware queues Bart Van Assche
2014-10-30 13:46 ` [PATCH v3 03/11] scsi_tcq.h: " Bart Van Assche
2014-10-30 13:46 ` Bart Van Assche [this message]
2014-10-30 13:46 ` [PATCH v3 05/11] IB/srp: Remove stale connection retry mechanism Bart Van Assche
2014-10-30 13:47 ` [PATCH v3 06/11] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning Bart Van Assche
[not found] ` <5452416A.1010403-HInyCGIudOg@public.gmane.org>
2014-10-30 14:28 ` Sagi Grimberg
2014-10-30 13:48 ` [PATCH v3 08/11] IB/srp: Separate target and channel variables Bart Van Assche
[not found] ` <545240AE.6060009-HInyCGIudOg@public.gmane.org>
2014-10-30 13:45 ` [PATCH v3 01/11] blk-mq: Add blk_mq_unique_tag() Bart Van Assche
2014-11-04 14:14 ` Christoph Hellwig
[not found] ` <20141104141432.GA446-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-11-05 12:37 ` Bart Van Assche
[not found] ` <545A19FA.40706-HInyCGIudOg@public.gmane.org>
2014-11-05 18:54 ` Christoph Hellwig
2014-11-06 14:22 ` Bart Van Assche
2014-10-30 13:48 ` [PATCH v3 07/11] IB/srp: Introduce two new srp_target_port member variables Bart Van Assche
2014-10-30 13:48 ` [PATCH v3 09/11] IB/srp: Use block layer tags Bart Van Assche
2014-10-30 14:30 ` Sagi Grimberg
[not found] ` <545241C7.5010707-HInyCGIudOg@public.gmane.org>
2014-11-12 10:45 ` Christoph Hellwig
[not found] ` <20141112104537.GA13223-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-11-24 15:43 ` Bart Van Assche
2014-10-30 13:49 ` [PATCH v3 10/11] IB/srp: Add multichannel support Bart Van Assche
2014-10-30 13:50 ` [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair Bart Van Assche
[not found] ` <5452420B.2070206-HInyCGIudOg@public.gmane.org>
2014-10-30 14:26 ` Sagi Grimberg
[not found] ` <54524A7B.3060708-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-10-30 14:53 ` Bart Van Assche
2014-10-30 15:10 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54524133.2060604@acm.org \
--to=bvanassche@acm.org \
--cc=Elliott@hp.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@canonical.com \
--cc=sagig@mellanox.com \
--cc=sebastian.riemer@profitbricks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.