From 8e65d4529120d46e9e72a7a60307190d81847165 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 2 Nov 2010 20:13:49 +0000 Subject: [PATCH] Merge of the trunk's r2575: Don't return SN errors on IMMEDIATE commands git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@2576 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 118d26a1f..1213d10af 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -1250,9 +1250,12 @@ static int check_cmd_sn(struct iscsi_cmnd *cmnd) cmnd->pdu.bhs.sn = cmd_sn = be32_to_cpu((__force __be32)cmnd->pdu.bhs.sn); TRACE_DBG("%d(%d)", cmd_sn, session->exp_cmd_sn); - if (likely((s32)(cmd_sn - session->exp_cmd_sn) >= 0)) + if ((s32)(cmd_sn - session->exp_cmd_sn) >= 0) return 0; - PRINT_ERROR("sequence error (%x,%x)", cmd_sn, session->exp_cmd_sn); + if (likely(cmnd->pdu.bhs.opcode & ISCSI_OP_IMMEDIATE)) + return 0; + PRINT_ERROR("sequence error (cmd sn %x, exp cmd sn %x, )", + cmd_sn, session->exp_cmd_sn); return -ISCSI_REASON_PROTOCOL_ERROR; }