Subject: bin/36354: iscsi-target doesn't work with linux 2.6.21.1 initiator
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 05/17/2007 02:40:01
>Number:         36354
>Category:       bin
>Synopsis:       iscsi-target doesn't work with linux 2.6.21.1 initiator
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 17 02:40:00 +0000 2007
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 4.99.19
>Organization:
	
>Environment:
Architecture: i386
Machine: i386
>Description:
	our iscsi-target expects that FirstBurstLen doesn't include
	immediate data, while linux 2.6.21.1's initiator seems to think
	it does.
	at a glance of the rfc, linux seems correct.  (please confirm.)
>How-To-Repeat:
	"dd if=/dev/zero of=/dev/sdc bs=1024k" on linux where sdc is
	our iscsi target.
>Fix:

Index: target.c
===================================================================
RCS file: /cvsroot/src/dist/iscsi/src/target.c,v
retrieving revision 1.17
diff -u -p -r1.17 target.c
--- target.c	3 Aug 2006 20:21:59 -0000	1.17
+++ target.c	17 May 2007 02:27:57 -0000
@@ -1346,7 +1346,7 @@ target_transfer_data(target_session_t * 
 		int             read_status = 0;
 		iscsi_r2t_t     r2t;
 		int             desired_xfer_len = MIN(sess->sess_params.first_burst_length,
-				      (args->trans_len - args->bytes_recv));
+				      args->trans_len) - args->bytes_recv;
 
 		(void) memset(&r2t, 0x0, sizeof(r2t));
 		do {

>Unformatted: