[PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The next patch will use a iscsi nop as a ping/test IO. For
that nop we will allow the user to specify a timeout value
that may be different from the hard coded or acl
nopin_response_timeout value.

This patch adds checks so if the nopin_response_timeout is
turned off we do not accidentally turn it on for the
user initiated test nop.

Signed-off-by: Mike Christie <mchristi@xxxxxxxxxx>
---
 drivers/target/iscsi/iscsi_target_util.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c
index 5a645b5..c51c14e 100644
--- a/drivers/target/iscsi/iscsi_target_util.c
+++ b/drivers/target/iscsi/iscsi_target_util.c
@@ -955,7 +955,8 @@ void iscsit_mod_nopin_response_timer(struct iscsi_conn *conn)
 	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);
 
 	spin_lock_bh(&conn->nopin_timer_lock);
-	if (!(conn->nopin_response_timer_flags & ISCSI_TF_RUNNING)) {
+	if (!na->nopin_response_timeout ||
+	    !(conn->nopin_response_timer_flags & ISCSI_TF_RUNNING)) {
 		spin_unlock_bh(&conn->nopin_timer_lock);
 		return;
 	}
@@ -974,7 +975,8 @@ void iscsit_start_nopin_response_timer(struct iscsi_conn *conn)
 	struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess);
 
 	spin_lock_bh(&conn->nopin_timer_lock);
-	if (conn->nopin_response_timer_flags & ISCSI_TF_RUNNING) {
+	if (!na->nopin_response_timeout ||
+	    conn->nopin_response_timer_flags & ISCSI_TF_RUNNING) {
 		spin_unlock_bh(&conn->nopin_timer_lock);
 		return;
 	}
-- 
2.7.2




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux