aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-02-03 15:53:51 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-03-04 20:54:09 -0500
commit5159d763f60af693a3fcec45dce2021f66e528a4 (patch)
tree9781d7b62561338f36bbd1bcc0ec093fa343a041 /drivers/target/iscsi
parenta2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 (diff)
iscsi/iser-target: Use list_del_init for ->i_conn_node
There are a handful of uses of list_empty() for cmd->i_conn_node within iser-target code that expect to return false once a cmd has been removed from the per connect list. This patch changes all uses of list_del -> list_del_init in order to ensure that list_empty() returns false as expected. Acked-by: Sagi Grimberg <sagig@mellanox.com> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: <stable@vger.kernel.org> #3.10+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r--drivers/target/iscsi/iscsi_target.c6
-rw-r--r--drivers/target/iscsi/iscsi_target_erl2.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 7f1a7ce4b771..ece82b0d8ea3 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -785,7 +785,7 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn)
785 spin_unlock_bh(&conn->cmd_lock); 785 spin_unlock_bh(&conn->cmd_lock);
786 786
787 list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) { 787 list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) {
788 list_del(&cmd->i_conn_node); 788 list_del_init(&cmd->i_conn_node);
789 iscsit_free_cmd(cmd, false); 789 iscsit_free_cmd(cmd, false);
790 } 790 }
791} 791}
@@ -3708,7 +3708,7 @@ iscsit_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state
3708 break; 3708 break;
3709 case ISTATE_REMOVE: 3709 case ISTATE_REMOVE:
3710 spin_lock_bh(&conn->cmd_lock); 3710 spin_lock_bh(&conn->cmd_lock);
3711 list_del(&cmd->i_conn_node); 3711 list_del_init(&cmd->i_conn_node);
3712 spin_unlock_bh(&conn->cmd_lock); 3712 spin_unlock_bh(&conn->cmd_lock);
3713 3713
3714 iscsit_free_cmd(cmd, false); 3714 iscsit_free_cmd(cmd, false);
@@ -4151,7 +4151,7 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
4151 spin_lock_bh(&conn->cmd_lock); 4151 spin_lock_bh(&conn->cmd_lock);
4152 list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) { 4152 list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) {
4153 4153
4154 list_del(&cmd->i_conn_node); 4154 list_del_init(&cmd->i_conn_node);
4155 spin_unlock_bh(&conn->cmd_lock); 4155 spin_unlock_bh(&conn->cmd_lock);
4156 4156
4157 iscsit_increment_maxcmdsn(cmd, sess); 4157 iscsit_increment_maxcmdsn(cmd, sess);
diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c
index 33be1fb1df32..4ca8fd2a70db 100644
--- a/drivers/target/iscsi/iscsi_target_erl2.c
+++ b/drivers/target/iscsi/iscsi_target_erl2.c
@@ -138,7 +138,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
138 list_for_each_entry_safe(cmd, cmd_tmp, 138 list_for_each_entry_safe(cmd, cmd_tmp,
139 &cr->conn_recovery_cmd_list, i_conn_node) { 139 &cr->conn_recovery_cmd_list, i_conn_node) {
140 140
141 list_del(&cmd->i_conn_node); 141 list_del_init(&cmd->i_conn_node);
142 cmd->conn = NULL; 142 cmd->conn = NULL;
143 spin_unlock(&cr->conn_recovery_cmd_lock); 143 spin_unlock(&cr->conn_recovery_cmd_lock);
144 iscsit_free_cmd(cmd, true); 144 iscsit_free_cmd(cmd, true);
@@ -160,7 +160,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
160 list_for_each_entry_safe(cmd, cmd_tmp, 160 list_for_each_entry_safe(cmd, cmd_tmp,
161 &cr->conn_recovery_cmd_list, i_conn_node) { 161 &cr->conn_recovery_cmd_list, i_conn_node) {
162 162
163 list_del(&cmd->i_conn_node); 163 list_del_init(&cmd->i_conn_node);
164 cmd->conn = NULL; 164 cmd->conn = NULL;
165 spin_unlock(&cr->conn_recovery_cmd_lock); 165 spin_unlock(&cr->conn_recovery_cmd_lock);
166 iscsit_free_cmd(cmd, true); 166 iscsit_free_cmd(cmd, true);
@@ -216,7 +216,7 @@ int iscsit_remove_cmd_from_connection_recovery(
216 } 216 }
217 cr = cmd->cr; 217 cr = cmd->cr;
218 218
219 list_del(&cmd->i_conn_node); 219 list_del_init(&cmd->i_conn_node);
220 return --cr->cmd_count; 220 return --cr->cmd_count;
221} 221}
222 222
@@ -297,7 +297,7 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn)
297 if (!(cmd->cmd_flags & ICF_OOO_CMDSN)) 297 if (!(cmd->cmd_flags & ICF_OOO_CMDSN))
298 continue; 298 continue;
299 299
300 list_del(&cmd->i_conn_node); 300 list_del_init(&cmd->i_conn_node);
301 301
302 spin_unlock_bh(&conn->cmd_lock); 302 spin_unlock_bh(&conn->cmd_lock);
303 iscsit_free_cmd(cmd, true); 303 iscsit_free_cmd(cmd, true);
@@ -335,7 +335,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
335 /* 335 /*
336 * Only perform connection recovery on ISCSI_OP_SCSI_CMD or 336 * Only perform connection recovery on ISCSI_OP_SCSI_CMD or
337 * ISCSI_OP_NOOP_OUT opcodes. For all other opcodes call 337 * ISCSI_OP_NOOP_OUT opcodes. For all other opcodes call
338 * list_del(&cmd->i_conn_node); to release the command to the 338 * list_del_init(&cmd->i_conn_node); to release the command to the
339 * session pool and remove it from the connection's list. 339 * session pool and remove it from the connection's list.
340 * 340 *
341 * Also stop the DataOUT timer, which will be restarted after 341 * Also stop the DataOUT timer, which will be restarted after
@@ -351,7 +351,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
351 " CID: %hu\n", cmd->iscsi_opcode, 351 " CID: %hu\n", cmd->iscsi_opcode,
352 cmd->init_task_tag, cmd->cmd_sn, conn->cid); 352 cmd->init_task_tag, cmd->cmd_sn, conn->cid);
353 353
354 list_del(&cmd->i_conn_node); 354 list_del_init(&cmd->i_conn_node);
355 spin_unlock_bh(&conn->cmd_lock); 355 spin_unlock_bh(&conn->cmd_lock);
356 iscsit_free_cmd(cmd, true); 356 iscsit_free_cmd(cmd, true);
357 spin_lock_bh(&conn->cmd_lock); 357 spin_lock_bh(&conn->cmd_lock);
@@ -371,7 +371,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
371 */ 371 */
372 if (!(cmd->cmd_flags & ICF_OOO_CMDSN) && !cmd->immediate_cmd && 372 if (!(cmd->cmd_flags & ICF_OOO_CMDSN) && !cmd->immediate_cmd &&
373 iscsi_sna_gte(cmd->cmd_sn, conn->sess->exp_cmd_sn)) { 373 iscsi_sna_gte(cmd->cmd_sn, conn->sess->exp_cmd_sn)) {
374 list_del(&cmd->i_conn_node); 374 list_del_init(&cmd->i_conn_node);
375 spin_unlock_bh(&conn->cmd_lock); 375 spin_unlock_bh(&conn->cmd_lock);
376 iscsit_free_cmd(cmd, true); 376 iscsit_free_cmd(cmd, true);
377 spin_lock_bh(&conn->cmd_lock); 377 spin_lock_bh(&conn->cmd_lock);
@@ -393,7 +393,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
393 393
394 cmd->sess = conn->sess; 394 cmd->sess = conn->sess;
395 395
396 list_del(&cmd->i_conn_node); 396 list_del_init(&cmd->i_conn_node);
397 spin_unlock_bh(&conn->cmd_lock); 397 spin_unlock_bh(&conn->cmd_lock);
398 398
399 iscsit_free_all_datain_reqs(cmd); 399 iscsit_free_all_datain_reqs(cmd);