All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: David Dillow <dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org>,
	Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Vu Pham <vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Sebastian Riemer
	<sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 6/6] IB/srp: Avoid that writing into "add_target" hangs due to a cable pull
Date: Thu, 20 Feb 2014 11:55:36 +0100	[thread overview]
Message-ID: <5305DF28.7090104@acm.org> (raw)
In-Reply-To: <5305DE01.7030004-HInyCGIudOg@public.gmane.org>

If a cable is pulled while srp_connect_target() is in progress
that can result in that function never to return. That makes the
process, e.g. srp_daemon, that invoked this function unkillable.
Avoid this by letting srp_connect_target() finish if the event
IB_CM_TIMEWAIT_EXIT is received. This patch fixes a hang with the
following call trace:
 [<ffffffff814eae85>] schedule_timeout+0x215/0x2e0
 [<ffffffff814eab03>] wait_for_common+0x123/0x180
 [<ffffffff814eac1d>] wait_for_completion+0x1d/0x20
 [<ffffffffa03b398c>] srp_connect_target+0x1dc/0x410 [ib_srp]
 [<ffffffffa03b5809>] srp_create_target+0xba9/0xe70 [ib_srp]
 [<ffffffff8133e590>] dev_attr_store+0x20/0x30
 [<ffffffff811eb8f5>] sysfs_write_file+0xe5/0x170
 [<ffffffff811767c8>] vfs_write+0xb8/0x1a0
 [<ffffffff811770c1>] sys_write+0x51/0x90
 [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b

Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Cc: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Sebastian Riemer <sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Cc: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 0d934b7..dcdaf49 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1873,6 +1873,7 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
 	case IB_CM_TIMEWAIT_EXIT:
 		shost_printk(KERN_ERR, target->scsi_host,
 			     PFX "connection closed\n");
+		comp = 1;
 
 		target->status = 0;
 		break;
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-02-20 10:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 10:50 [PATCH 0/6] SRP initiator patches for kernel 3.15 Bart Van Assche
     [not found] ` <5305DE01.7030004-HInyCGIudOg@public.gmane.org>
2014-02-20 10:51   ` [PATCH 1/6] scsi_transport_srp: Fix two kernel-doc warnings Bart Van Assche
     [not found]     ` <5305DE2C.4080203-HInyCGIudOg@public.gmane.org>
2014-02-20 12:01       ` Sebastian Riemer
2014-02-20 10:52   ` [PATCH 3/6] IB/srp: Fail SCSI commands silently Bart Van Assche
     [not found]     ` <5305DE67.9070805-HInyCGIudOg@public.gmane.org>
2014-02-20 10:57       ` Bart Van Assche
2014-02-21  3:55       ` David Dillow
     [not found]         ` <1392954937.26557.3.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-21  9:23           ` Bart Van Assche
     [not found]             ` <53071B2E.2050302-HInyCGIudOg@public.gmane.org>
2014-02-22  5:41               ` David Dillow
     [not found]                 ` <1393047697.12377.11.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-24 19:58                   ` Bart Van Assche
     [not found]                     ` <530BA476.7040005-HInyCGIudOg@public.gmane.org>
2014-02-25  4:36                       ` David Dillow
     [not found]                         ` <1393302995.9096.1.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-25 10:33                           ` Bart Van Assche
     [not found]                             ` <530C7175.5060907-HInyCGIudOg@public.gmane.org>
2014-02-26  6:32                               ` David Dillow
     [not found]                                 ` <1393396377.12328.5.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-26 13:16                                   ` Bart Van Assche
     [not found]                                     ` <530DE93A.2040400-HInyCGIudOg@public.gmane.org>
2014-02-27  5:48                                       ` David Dillow
     [not found]                                         ` <1393480118.16410.10.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-27 13:44                                           ` Bart Van Assche
2014-02-20 10:53   ` [PATCH 4/6] IB/srp: Avoid duplicate connections Bart Van Assche
2014-02-20 10:54   ` [PATCH 5/6] IB/srp: Make writing into the "add_target" sysfs attribute interruptible Bart Van Assche
2014-02-20 10:55   ` Bart Van Assche [this message]
2014-02-20 10:56   ` [PATCH 2/6] IB/srp: Add more logging Bart Van Assche
2014-02-21  3:36   ` [PATCH 0/6] SRP initiator patches for kernel 3.15 Vasiliy Tolstov
     [not found]     ` <CACaajQt5FVw-8rVhM1jwZPORGNdrAkTf-Gi3NdkKRnQaYde48Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-21 12:20       ` Bart Van Assche

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=5305DF28.7090104@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
    --cc=vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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.