aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/target/iscsi/iscsi_target_erl1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
index 7816af6cdd12..40d9dbca987b 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
@@ -823,7 +823,7 @@ static int iscsit_attach_ooo_cmdsn(
823 /* 823 /*
824 * CmdSN is greater than the tail of the list. 824 * CmdSN is greater than the tail of the list.
825 */ 825 */
826 if (ooo_tail->cmdsn < ooo_cmdsn->cmdsn) 826 if (iscsi_sna_lt(ooo_tail->cmdsn, ooo_cmdsn->cmdsn))
827 list_add_tail(&ooo_cmdsn->ooo_list, 827 list_add_tail(&ooo_cmdsn->ooo_list,
828 &sess->sess_ooo_cmdsn_list); 828 &sess->sess_ooo_cmdsn_list);
829 else { 829 else {
@@ -833,11 +833,12 @@ static int iscsit_attach_ooo_cmdsn(
833 */ 833 */
834 list_for_each_entry(ooo_tmp, &sess->sess_ooo_cmdsn_list, 834 list_for_each_entry(ooo_tmp, &sess->sess_ooo_cmdsn_list,
835 ooo_list) { 835 ooo_list) {
836 if (ooo_tmp->cmdsn < ooo_cmdsn->cmdsn) 836 if (iscsi_sna_lt(ooo_tmp->cmdsn, ooo_cmdsn->cmdsn))
837 continue; 837 continue;
838 838
839 /* Insert before this entry */
839 list_add(&ooo_cmdsn->ooo_list, 840 list_add(&ooo_cmdsn->ooo_list,
840 &ooo_tmp->ooo_list); 841 ooo_tmp->ooo_list.prev);
841 break; 842 break;
842 } 843 }
843 } 844 }