target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer
@ 2018-07-15 23:16 Mike Christie
  2018-07-19 20:48 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Christie @ 2018-07-15 23:16 UTC (permalink / raw)
  To: target-devel

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@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer
  2018-07-15 23:16 [PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer Mike Christie
@ 2018-07-19 20:48 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-07-19 20:48 UTC (permalink / raw)
  To: target-devel

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-19 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-15 23:16 [PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer Mike Christie
2018-07-19 20:48 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).