IB/srp: force reconnect_delay module param to exceed fast_io_fail_tmo
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Jul 2017 22:43:06 +0000 (01:43 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Jul 2017 22:43:06 +0000 (01:43 +0300)
This commit works-around a rare warning caused by a race condition between
srp_post_send and srp_rport_reconnect.
When reconnect_delay <= fast_io_fail_tmo, race condition of calling
srp_terminate_io() while srp_queuecommand() is running is not safe.
Forcing reconnect_delay > fast_io_fail_tmo causes all I/O to fail
before trying to reconnect to target.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
patches/0008-BACKPORT-ib_srp.patch

index a7918ca..0803845 100644 (file)
@@ -4,9 +4,9 @@ Subject: [PATCH] BACKPORT: ib_srp
 Change-Id: Ic90bc43f6bd61818530da7fb700962a8e1ef4aa5
 Signed-off-by: Israel Rukshin <israelr@mellanox.com>
 ---
- drivers/infiniband/ulp/srp/ib_srp.c | 175 ++++++++++++++++++++++++++++++++++++
+ drivers/infiniband/ulp/srp/ib_srp.c | 177 +++++++++++++++++++++++++++++++++++-
  drivers/infiniband/ulp/srp/ib_srp.h |   7 ++
- 2 files changed, 182 insertions(+)
+ 2 files changed, 183 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
 index xxxxxxx..xxxxxxx xxxxxx
@@ -26,6 +26,15 @@ index xxxxxxx..xxxxxxx xxxxxx
  
  module_param(allow_ext_sg, bool, 0444);
  MODULE_PARM_DESC(allow_ext_sg,
+@@ -105,7 +110,7 @@ MODULE_PARM_DESC(never_register, "Never register memory");
+ static const struct kernel_param_ops srp_tmo_ops;
+-static int srp_reconnect_delay = 10;
++static int srp_reconnect_delay = 20;
+ module_param_cb(reconnect_delay, &srp_tmo_ops, &srp_reconnect_delay,
+               S_IRUGO | S_IWUSR);
+ MODULE_PARM_DESC(reconnect_delay, "Time between successive reconnect attempts");
 @@ -131,8 +136,12 @@ MODULE_PARM_DESC(dev_loss_tmo,
  
  static unsigned ch_count;