gostor / gotgt

Simple Golang iSCSI Target framework
Apache License 2.0
261 stars 49 forks source link

gotgt not working properly over network #46

Closed payes closed 7 years ago

payes commented 7 years ago

Test Case 1:

Tried to run the below sequence of commands:

sudo dd if=/dev/urandom of=test1 bs=32k count=1
md5sum test1
sudo dd of=/dev/sdb if=test1 bs=32k count=1
sudo dd of=test2 if=/dev/sdb bs=32k count=1
md5sum test2

/dev/sdb -- Device path at initiator after login When initiator and target are on the same host (even on two VMs on the same host), md5sum of file1 and file2 matches. But when the initiator and target are on separate hosts over physical network, the md5sum of file1 and file2 doesn't match.

Test Case 2:

mkfs.ext4 /dev/sdb was successful. But when initiator and target were on separate hosts, mount failed with the below message:

mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

logs:

Jan 30 16:02:02 Cent10 kernel: scsi11 : iSCSI Initiator over TCP/IP
Jan 30 16:02:02 Cent10 kernel: scsi 11:0:0:0: Direct-Access     GOSTOR   GOTGT            0.1  PQ: 0 ANSI: 5
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: Attached scsi generic sg2 type 0
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB)
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] 4096-byte physical blocks
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Write Protect is off
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Asking for cache data failed
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Assuming drive cache: write through
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Asking for cache data failed
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Assuming drive cache: write through
Jan 30 16:02:02 Cent10 kernel: sdb: unknown partition table
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Asking for cache data failed
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Assuming drive cache: write through
Jan 30 16:02:02 Cent10 kernel: sd 11:0:0:0: [sdb] Attached SCSI disk
Jan 30 16:02:02 Cent10 iscsid: Connection9:0 to [target: iqn.2016-09.com.openebs.jiva:volx, portal: 20.10.92.2,3260] through [iface: default] is operational now
Jan 30 16:02:47 Cent10 kernel: EXT4-fs (sdb): ext4_check_descriptors: Checksum for group 0 failed (48625!=0)
Jan 30 16:02:47 Cent10 kernel: EXT4-fs (sdb): group descriptors corrupted!

After these tests: I even attempted to assign MaxCmdSN=ExpCmdSN so that initiator doesn't send the next command until it gets a response for the last command. Still the above test cases are failing.

carmark commented 7 years ago

It looks a bug, but I am a little busy recently, will fix this ASAP.