iscsi target: check nopin_response_timeout before starting timer
PATCH 13/15 iscsi target: check nopin_response_timeout before starting timer
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 <[email protected]>
--- drivers/target/iscsi/iscsi_target_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/target/iscsi/iscsi_target_util.c +4 -2
@@ -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 ; }
Signature · 1 line
2.7.2
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>