[Stgt-devel] [PATCH] head and data digest

Albert Pauw albert.pauw
Mon Apr 23 19:21:56 CEST 2007


FUJITA Tomonori wrote:
> From: Albert Pauw <albert.pauw at gmail.com>
> Subject: Re: [Stgt-devel] [PATCH] head and data digest
> Date: Sun, 22 Apr 2007 17:39:26 +0200
>
>   
>> I set HeaderDigest to CRC32C on the disk target:
>>     
>
> Do you enable the features? Here's an example:
>
> root at ac:~/git# ./tgt/usr/tgtadm --op show --mode target --tid 1
> MaxRecvDataSegmentLength=8192
> MaxXmitDataSegmentLength=8192
> HeaderDigest=None
> DataDigest=None
> InitialR2T=Yes
> MaxOutstandingR2T=1
> ImmediateData=Yes
> FirstBurstLength=65536
> MaxBurstLength=262144
> DataPDUInOrder=Yes
> DataSequenceInOrder=Yes
> ErrorRecoveryLevel=0
> IFMarker=No
> OFMarker=No
> DefaultTime2Wait=2
> DefaultTime2Retain=20
> OFMarkInt=Reject
> IFMarkInt=Reject
> MaxConnections=1
>
> root at ac:~/git# ./tgt/usr/tgtadm --op update --mode target --tid 1 -n HeaderDigest -v CRC32C
> root at ac:~/git# ./tgt/usr/tgtadm --op update --mode target --tid 1 -n DataDigest -v CRC32C
>
> root at ac:~/git# ./tgt/usr/tgtadm --op show --mode target --tid 1
> MaxRecvDataSegmentLength=8192
> MaxXmitDataSegmentLength=8192
> HeaderDigest=CRC32C
> DataDigest=CRC32C
> InitialR2T=Yes
> MaxOutstandingR2T=1
> ImmediateData=Yes
> FirstBurstLength=65536
> MaxBurstLength=262144
> DataPDUInOrder=Yes
> DataSequenceInOrder=Yes
> ErrorRecoveryLevel=0
> IFMarker=No
> OFMarker=No
> DefaultTime2Wait=2
> DefaultTime2Retain=20
> OFMarkInt=Reject
> IFMarkInt=Reject
> MaxConnections=1
>
> With this configuration, the target accepts CRC32C and
> None. Currently, there is no way to configure a target to accept only
> CRC32C.
>
> If it still doesn't work for you, please send the tcpdump log during a
> login process.
>
>   
Ok, login works fine, if I look with wireshark I can see that the digest
is ok.
However, I seem to be having another problem now, with or without digest.

When I login, it works fine. When I partition the disk and create a
filesystem
on the partition it seems to be fine as well. However, when I try to
mount that
filesystem I get an error:

[root at orange ~]# fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 104 MB, 104857600 bytes
4 heads, 50 sectors/track, 1024 cylinders
Units = cylinders of 200 * 512 = 102400 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1024      102375   83  Linux

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1024, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1024, default 1024):
Using default value 1024

Command (m for help): p

Disk /dev/sdb: 104 MB, 104857600 bytes
4 heads, 50 sectors/track, 1024 cylinders
Units = cylinders of 200 * 512 = 102400 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1024      102375   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root at orange ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102372 blocks
5118 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root at orange ~]# mount /dev/sdb1 /mnt/disk1
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so







More information about the stgt mailing list