]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.fixes/libiscsi-have-iscsi_data_in_rsp-call-iscsi_update_cmdsn
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / libiscsi-have-iscsi_data_in_rsp-call-iscsi_update_cmdsn
1 From: Hannes Reinecke <hare@suse.de>
2 Date: Tue, 18 Aug 2009 10:06:31 +0200
3 Subject: libiscsi: have iscsi_data_in_rsp call iscsi_update_cmdsn
4 References: bnc#472432
5 X-Git: edbc9aa0580c0aca96ac8d11bfb2defa81d91bb3
6
7 This has iscsi_data_in_rsp call iscsi_update_cmdsn when a pdu is
8 completed like is done for other pdu's that are don.
9
10 For iscsi_tcp, this means that it calls iscsi_update_cmdsn when
11 it is handling the pdu internally to only transfer data, but if there is
12 status then it does not need to call it since the completion handling
13 will do it.
14
15 Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
16 Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 Signed-off-by: Hannes Reinecke <hare@suse.de>
18 ---
19 drivers/scsi/iscsi_tcp.c | 8 +++++++-
20 drivers/scsi/libiscsi.c | 1 +
21 2 files changed, 8 insertions(+), 1 deletions(-)
22
23 diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
24 index babe81a..19fae4d 100644
25 --- a/drivers/scsi/iscsi_tcp.c
26 +++ b/drivers/scsi/iscsi_tcp.c
27 @@ -543,7 +543,13 @@ iscsi_data_in(struct iscsi_conn *conn, struct iscsi_task *task)
28 int datasn = be32_to_cpu(rhdr->datasn);
29 unsigned total_in_length = scsi_in(task->sc)->length;
30
31 - iscsi_update_cmdsn(conn->session, (struct iscsi_nopin*)rhdr);
32 + /*
33 + * lib iscsi will update this in the completion handling if there
34 + * is status.
35 + */
36 + if (!(rhdr->flags & ISCSI_FLAG_DATA_STATUS))
37 + iscsi_update_cmdsn(conn->session, (struct iscsi_nopin*)rhdr);
38 +
39 if (tcp_conn->in.datalen == 0)
40 return 0;
41
42 diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
43 index 8905895..0611558 100644
44 --- a/drivers/scsi/libiscsi.c
45 +++ b/drivers/scsi/libiscsi.c
46 @@ -661,6 +661,7 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
47 if (!(rhdr->flags & ISCSI_FLAG_DATA_STATUS))
48 return;
49
50 + iscsi_update_cmdsn(conn->session, (struct iscsi_nopin *)hdr);
51 sc->result = (DID_OK << 16) | rhdr->cmd_status;
52 conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
53 if (rhdr->flags & (ISCSI_FLAG_DATA_UNDERFLOW |
54 --
55 1.6.0.2
56