[stgt] Bug report - Reading short block using passthrough.

Mark Harvey markh794 at gmail.com
Thu Apr 7 07:48:35 CEST 2011


Write a 1k block of data to the tape device.
# dd if=/etc/passwd of=/dev/st0 bs=1k count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.0290604 s, 35.2 kB/s

Read the 1k block of data
# dd if=/dev/st0 of=/tmp/b1 bs=1k count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.00822856 s, 124 kB/s

Verify it contains data..
# strings /tmp/b1
at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash
ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
games:x:12:100:Games account:/var/games:/bin/bash
gdm:x:106:111:Gnome Display Manager daemon:/var/lib/gdm:/bin/false
haldaemon:x:101:102:User for haldaemon:/var/run/hald:/bin/false
lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false
man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
messagebus:x:100:101:User for D-Bus:/var/run/dbus:/bin/false
news:x:9:13:News system:/etc/news:/bin/bash
nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
ntp:x:74:105:NTP daemon:/var/lib/ntp:/bin/false
polkituser:x:103:106:PolicyKit:/var/run/PolicyKit:/bin/false
postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
pulse:x:104:107:PulseAudio daemon:/var/lib/pulseaudio:/sbin/nologin
root:x:0:0:root:/root:/bin/bash
sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false
suse-ncc:x:105:110:Novell Custom

Read the same block of data but specify a larger block size
# dd if=/dev/st0 of=/tmp/b1 bs=10k count=1
0+1 records in
0+1 records out
1024 bytes (1.0 kB) copied, 0.00821022 s, 125 kB/s

(This returns the correct block size of 1k - good)

Now confirm the data is valid.
~ # strings /tmp/b1
~ #
Oops. All the data is NULL

And again using hexdump
# hexdump -C /tmp/b1
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000400


I'm going to have a look and see if I can spot where the problem is,
however I'm posting this in the hope somebody can spot the bug earlier
than me :)

Cheers
Mark
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list