aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2014-03-14 08:53:10 -0400
committerRoland Dreier <roland@purestorage.com>2014-03-24 13:05:31 -0400
commita702adceec3eeee23d95a81a0663661e7c25ad9c (patch)
tree815a42566f0576b7921d36df89e0eda8c55d9eec /drivers/infiniband/ulp/srp
parent2d7091bcf6f893a9b1a2add357c637055eae4e68 (diff)
IB/srp: Make writing into the "add_target" sysfs attribute interruptible
Avoid that stopping srp_daemon takes unusually long due to a cable pull by making writing into the "add_target" sysfs attribute interruptible. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 3294f10316a0..481c873f735e 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -411,6 +411,8 @@ static void srp_path_rec_completion(int status,
411 411
412static int srp_lookup_path(struct srp_target_port *target) 412static int srp_lookup_path(struct srp_target_port *target)
413{ 413{
414 int ret;
415
414 target->path.numb_path = 1; 416 target->path.numb_path = 1;
415 417
416 init_completion(&target->done); 418 init_completion(&target->done);
@@ -431,7 +433,9 @@ static int srp_lookup_path(struct srp_target_port *target)
431 if (target->path_query_id < 0) 433 if (target->path_query_id < 0)
432 return target->path_query_id; 434 return target->path_query_id;
433 435
434 wait_for_completion(&target->done); 436 ret = wait_for_completion_interruptible(&target->done);
437 if (ret < 0)
438 return ret;
435 439
436 if (target->status < 0) 440 if (target->status < 0)
437 shost_printk(KERN_WARNING, target->scsi_host, 441 shost_printk(KERN_WARNING, target->scsi_host,
@@ -710,7 +714,9 @@ static int srp_connect_target(struct srp_target_port *target)
710 ret = srp_send_req(target); 714 ret = srp_send_req(target);
711 if (ret) 715 if (ret)
712 return ret; 716 return ret;
713 wait_for_completion(&target->done); 717 ret = wait_for_completion_interruptible(&target->done);
718 if (ret < 0)
719 return ret;
714 720
715 /* 721 /*
716 * The CM event handling code will set status to 722 * The CM event handling code will set status to