From bernd@heitec.net  Wed Dec 20 11:53:04 2006
Return-Path: <bernd@heitec.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id ABB2316A40F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 2006 11:53:04 +0000 (UTC)
	(envelope-from bernd@heitec.net)
Received: from christel.heitec.net (christel.heitec.net [62.206.253.11])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 765BE43C9F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 2006 11:53:03 +0000 (GMT)
	(envelope-from bernd@heitec.net)
Received: from tostan.admin.er.heitec.net (paladin.heitec.net [62.206.253.14])
	by christel.heitec.net (Postfix) with ESMTP id 47E22A8937
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 2006 12:30:10 +0100 (CET)
Received: (from bernd@localhost)
	by tostan.admin.er.heitec.net (8.13.8/8.13.8/Submit) id kBKBQgEv041082;
	Wed, 20 Dec 2006 12:26:42 +0100 (CET)
	(envelope-from bernd)
Message-Id: <200612201126.kBKBQgEv041082@tostan.admin.er.heitec.net>
Date: Wed, 20 Dec 2006 12:26:42 +0100 (CET)
From: Bernd Luevelsmeyer <bdluevel@heitec.net>
Reply-To: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: 'tar' cannot read own tape, but 'pax' can
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         106973
>Category:       kern
>Synopsis:       SCSI tape driver claims to be able to do lseek() while in fact it cannot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kientzle
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 20 12:00:32 GMT 2006
>Closed-Date:    Fri Jul 13 12:34:38 GMT 2007
>Last-Modified:  Fri Jul 13 12:34:38 GMT 2007
>Originator:     Bernd Luevelsmeyer
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD 6.2-PRERELEASE Fri Dec 15 16:51:04 CET 2006 i386


	
>Description:
After storing files on a tape with 'tar -cv', reading the tape with
'tar -tv' produces an error. Reading with 'pax' succeeds. The tape
can also be read with 'cp' or 'dd', but not with 'cat'. The success
and failure of these tools is repeatable. I've put a session-script
into the "how to repeat"-section of this PR.

The tape drive is the device /dev/sa0, a Travan-thing on the SCSI
bus. Here is a dmesg.boot of a verbose boot:

Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 6.2-PRERELEASE #0: Fri Dec 15 16:51:04 CET 2006
    bernd@tostan.admin.er.heitec.net:/usr/obj/usr/src/sys/TOSTAN
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0724000.
Preloaded elf module "/boot/modules/acpi.ko" at 0xc072416c.
Calibrating clock(s) ... i8254 clock: 1193176 Hz
CLK_USE_I8254_CALIBRATION not specified - using default frequency
Timecounter "i8254" frequency 1193182 Hz quality 0
Calibrating TSC clock ... TSC clock: 400910795 Hz
CPU: Pentium II/Pentium II Xeon/Celeron (400.91-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x651  Stepping = 1
  Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
real memory  = 268423168 (255 MB)
Physical memory chunk(s):
0x0000000000001000 - 0x000000000009efff, 647168 bytes (158 pages)
0x0000000000100000 - 0x00000000003fffff, 3145728 bytes (768 pages)
0x0000000000825000 - 0x000000000fb3afff, 254894080 bytes (62230 pages)
avail memory = 257454080 (245 MB)
bios32: Found BIOS32 Service Directory header at 0xc00f9d60
bios32: Entry = 0xf0520 (c00f0520)  Rev = 0  Len = 1
pcibios: PCI BIOS entry at 0xf0000+0x720
pnpbios: Found PnP BIOS data at 0xc00fd1b0
pnpbios: Entry = f0000:d1e0  Rev = 1.0
pnpbios: OEM ID cd041
Other BIOS signatures found:
netsmb_dev: loaded
null: <null device, zero device>
io: <I/O>
random: <entropy source, Software, Yarrow>
mem: <memory>
Pentium Pro MTRR support enabled
npx0: INT 16 interface
acpi0: <ASUS P2B-LS> on motherboard
acpi0: [MPSAFE]
pci_open(1):	mode 1 addr port (0x0cf8) is 0x80002358
pci_open(1a):	mode1res=0x80000000 (0x80000000)
pci_cfgcheck:	device 0 [class=060000] [hdr=00] is there (id=71908086)
pcibios: BIOS version 2.10
acpi_bus_number: root bus has no _BBN, assuming 0
AcpiOsDerivePciId: bus 0 dev 4 func 0
acpi0: Power Button (fixed)
acpi0: wakeup code va 0xc6fac000 pa 0x9e000
atpic: Programming IRQ9 as level/low
acpi_bus_number: root bus has no _BBN, assuming 0
AcpiOsDerivePciId: bus 0 dev 4 func 3
acpi_bus_number: root bus has no _BBN, assuming 0
AcpiOsDerivePciId: bus 0 dev 4 func 3
ACPI timer: 0/4 0/4 0/4 0/16777209 0/4 0/4 0/16777186 0/4 0/6 0/4 -> 0
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xe408-0xe40b on acpi0
pci_link0:        Index  IRQ  Rtd  Ref  IRQs
  Initial Probe       0   11   N     0  3 4 5 6 7 9 10 11 12 14 15
  Validation          0   11   N     0  3 4 5 6 7 9 10 11 12 14 15
  After Disable       0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
pci_link1:        Index  IRQ  Rtd  Ref  IRQs
  Initial Probe       0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
  Validation          0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
  After Disable       0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
pci_link2:        Index  IRQ  Rtd  Ref  IRQs
  Initial Probe       0   10   N     0  3 4 5 6 7 9 10 11 12 14 15
  Validation          0   10   N     0  3 4 5 6 7 9 10 11 12 14 15
  After Disable       0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
pci_link3:        Index  IRQ  Rtd  Ref  IRQs
  Initial Probe       0   15   N     0  3 4 5 6 7 9 10 11 12 14 15
  Validation          0   15   N     0  3 4 5 6 7 9 10 11 12 14 15
  After Disable       0  255   N     0  3 4 5 6 7 9 10 11 12 14 15
cpu0: <ACPI CPU> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
ACPI: Found matching pin for 0.12.INTA at func 0: 11
ACPI: Found matching pin for 0.10.INTA at func 0: 10
ACPI: Found matching pin for 0.4.INTD at func 2: 255
ACPI: Found matching pin for 0.6.INTA at func 0: 15
pci0: <ACPI PCI bus> on pcib0
pci0: physical bus=0
found->	vendor=0x8086, dev=0x7190, revid=0x02
	bus=0, slot=0, func=0
	class=06-00-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0106, statreg=0x2210, cachelnsz=0 (dwords)
	lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	map[10]: type 3, range 32, base e7800000, size 22, enabled
found->	vendor=0x8086, dev=0x7191, revid=0x02
	bus=0, slot=1, func=0
	class=06-04-00, hdrtype=0x01, mfdev=0
	cmdreg=0x0117, statreg=0x0220, cachelnsz=0 (dwords)
	lattimer=0x40 (1920 ns), mingnt=0x88 (34000 ns), maxlat=0x00 (0 ns)
found->	vendor=0x8086, dev=0x7110, revid=0x02
	bus=0, slot=4, func=0
	class=06-01-00, hdrtype=0x00, mfdev=1
	cmdreg=0x000f, statreg=0x0280, cachelnsz=0 (dwords)
	lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
found->	vendor=0x8086, dev=0x7111, revid=0x01
	bus=0, slot=4, func=1
	class=01-01-80, hdrtype=0x00, mfdev=0
	cmdreg=0x0000, statreg=0x0280, cachelnsz=0 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	map[20]: type 4, range 32, base 0000b800, size  4, port disabled
found->	vendor=0x8086, dev=0x7112, revid=0x01
	bus=0, slot=4, func=2
	class=0c-03-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0005, statreg=0x0280, cachelnsz=0 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=d, irq=255
	map[20]: type 4, range 32, base 0000b400, size  5, enabled
found->	vendor=0x8086, dev=0x7113, revid=0x02
	bus=0, slot=4, func=3
	class=06-80-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0003, statreg=0x0280, cachelnsz=0 (dwords)
	lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	map[90]: type 4, range 32, base 0000e800, size  4, enabled
found->	vendor=0x9005, dev=0x001f, revid=0x00
	bus=0, slot=6, func=0
	class=01-00-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0017, statreg=0x0290, cachelnsz=8 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x27 (9750 ns), maxlat=0x19 (6250 ns)
	intpin=a, irq=15
	powerspec 1  supports D0 D3  current D0
	map[10]: type 4, range 32, base 0000b000, size  8, enabled
	map[14]: type 1, range 64, base e3800000, size 12, enabled
pcib0: matched entry for 0.6.INTA (src \\_SB_.LNKD:0)
pcib0: slot 6 INTA routed to irq 15 via \\_SB_.LNKD
found->	vendor=0x1274, dev=0x1371, revid=0x08
	bus=0, slot=10, func=0
	class=04-01-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0005, statreg=0x0410, cachelnsz=0 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x0c (3000 ns), maxlat=0x80 (32000 ns)
	intpin=a, irq=10
	powerspec 1  supports D0 D2 D3  current D0
	map[10]: type 4, range 32, base 0000a800, size  6, enabled
pcib0: matched entry for 0.10.INTA (src \\_SB_.LNKC:0)
pcib0: slot 10 INTA routed to irq 10 via \\_SB_.LNKC
found->	vendor=0x8086, dev=0x1229, revid=0x05
	bus=0, slot=12, func=0
	class=02-00-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0017, statreg=0x0290, cachelnsz=8 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x08 (2000 ns), maxlat=0x38 (14000 ns)
	intpin=a, irq=11
	powerspec 1  supports D0 D1 D2 D3  current D0
	map[10]: type 3, range 32, base e5000000, size 12, enabled
	map[14]: type 4, range 32, base 0000a400, size  5, enabled
	map[18]: type 1, range 32, base e3000000, size 20, enabled
pcib0: matched entry for 0.12.INTA (src \\_SB_.LNKA:0)
pcib0: slot 12 INTA routed to irq 11 via \\_SB_.LNKA
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pcib1:   secondary bus     1
pcib1:   subordinate bus   1
pcib1:   I/O decode        0xd000-0xdfff
pcib1:   memory decode     0xe4000000-0xe4efffff
pcib1:   prefetched decode 0xe5f00000-0xe77fffff
pci1: <PCI bus> on pcib1
pci1: physical bus=1
found->	vendor=0x1002, dev=0x4742, revid=0x5c
	bus=1, slot=0, func=0
	class=03-00-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0087, statreg=0x0290, cachelnsz=8 (dwords)
	lattimer=0x40 (1920 ns), mingnt=0x08 (2000 ns), maxlat=0x00 (0 ns)
	map[10]: type 3, range 32, base e6000000, size 24, enabled
pcib1: requested memory range 0xe6000000-0xe6ffffff: good
	map[14]: type 4, range 32, base 0000d800, size  8, enabled
pcib1: requested I/O range 0xd800-0xd8ff: in range
	map[18]: type 1, range 32, base e4000000, size 12, enabled
pcib1: requested memory range 0xe4000000-0xe4000fff: good
pci1: <display, VGA> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 4.0 on pci0
isa0: <ISA bus> on isab0
pci0: <mass storage, ATA> at device 4.1 (no driver attached)
pci0: <serial bus, USB> at device 4.2 (no driver attached)
intpm0: <Intel 82371AB Power management controller> port 0xe800-0xe80f irq 9 at device 4.3 on pci0
intpm0: Reserved 0x10 bytes for rid 0x90 type 4 at 0xe800
intpm0: I/O mapped e800
intpm0: intr IRQ 9 enabled revision 0
intpm0: [GIANT-LOCKED]
intsmb0: <Intel PIIX4 SMBUS Interface> on intpm0
smbus1: <System Management Bus> on intsmb0
smb0: <SMBus generic I/O> on smbus1
intpm0: PM I/O mapped e400 
ahc0: <Adaptec aic7890/91 Ultra2 SCSI adapter> port 0xb000-0xb0ff mem 0xe3800000-0xe3800fff irq 15 at device 6.0 on pci0
ahc0: Defaulting to MEMIO on
ahc0: Reserved 0x1000 bytes for rid 0x14 type 3 at 0xe3800000
ahc0: Reading SEEPROM...done.
ahc0: Manual SE Termination
ahc0: Manual LVD Termination
ahc0: BIOS eeprom is present
ahc0: Primary Low Byte termination Enabled
ahc0: Primary High Byte termination Enabled
ahc0: Downloading Sequencer Program... 424 instructions downloaded
ahc0: Features 0x56f6, Bugs 0x6, Flags 0x20485560
ahc0: [GIANT-LOCKED]
aic7890/91: Ultra2 Wide Channel A, SCSI Id=7, 32/253 SCBs
pcm0: <AudioPCI ES1373-8> port 0xa800-0xa83f irq 10 at device 10.0 on pci0
pcm0: Reserved 0x40 bytes for rid 0x10 type 4 at 0xa800
pcm0: <Cirrus Logic CS4297A AC97 Codec (id = 0x43525913)>
pcm0: Codec features headphone, 20 bit DAC, 18 bit ADC, 6 bit master volume, Crystal Semi 3D Stereo Enhancement
pcm0: Primary codec extended features AMAP
pcm0: ac97 codec dac ready count: 0
pcm0: [MPSAFE]
pcm0: sndbuf_setmap 189000, 1000; 0xc1e35000 -> 189000
pcm0: sndbuf_setmap 167000, 1000; 0xc1e33000 -> 167000
pcm0: <Playback: DAC2 / Record: ADC>
fxp0: <Intel 82558 Pro/100 Ethernet> port 0xa400-0xa41f mem 0xe5000000-0xe5000fff,0xe3000000-0xe30fffff irq 11 at device 12.0 on pci0
fxp0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xe5000000
fxp0: using memory space register mapping
fxp0: PCI IDs: 8086 1229 8086 0009 0005
fxp0: Dynamic Standby mode is disabled
miibus0: <MII bus> on fxp0
inphy0: <i82555 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: bpf attached
fxp0: Ethernet address: 00:90:27:2e:e0:c7
fxp0: [MPSAFE]
fdc0: <floppy drive controller> port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: ic_type 90 part_id 80
fdc0: [MPSAFE]
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
fd1: <1200-KB 5.25" drive> on fdc0 drive 1
ppc0: using extended I/O port range
ppc0: ECP SPP ECP+EPP SPP
ppc0: <ECP parallel printer port> port 0x378-0x37b,0x778-0x77b irq 7 drq 3 flags 0xf on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in ECP+EPP mode (EPP 1.9)
ppc0: FIFO with 16/16/9 bytes threshold
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
sio0: irq maps: 0x1 0x11 0x1 0x1
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x30 on acpi0
sio0: type 16550A, console
sio1: irq maps: 0x1 0x9 0x1 0x1
sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
fdc: fdc0 already exists; skipping it
ppc: ppc0 already exists; skipping it
sio: sio0 already exists; skipping it
sio: sio1 already exists; skipping it
pnp_identify: Trying Read_Port at 203
pnp_identify: Trying Read_Port at 243
pnp_identify: Trying Read_Port at 283
pnp_identify: Trying Read_Port at 2c3
pnp_identify: Trying Read_Port at 303
pnp_identify: Trying Read_Port at 343
pnp_identify: Trying Read_Port at 383
pnp_identify: Trying Read_Port at 3c3
PNP Identify complete
isa_probe_children: disabling PnP devices
isa_probe_children: probing non-PnP devices
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xcd7ff on isa0
isa_probe_children: probing PnP devices
Device configuration finished.
Timecounter "TSC" frequency 400910795 Hz quality 800
Timecounters tick every 1.000 msec
lo0: bpf attached
Waiting 2 seconds for SCSI devices to settle
(noperiph:ahc0:0:-1:-1): SCSI bus reset delivered. 0 SCBs aborted.
ahc0: Selection Timeout on A:9. 0 SCBs aborted
ahc0: Selection Timeout on A:3. 0 SCBs aborted
ahc0: Selection Timeout on A:6. 0 SCBs aborted
ahc0: Selection Timeout on A:8. 0 SCBs aborted
ahc0: Selection Timeout on A:10. 0 SCBs aborted
ahc0: Selection Timeout on A:11. 0 SCBs aborted
ahc0: Selection Timeout on A:12. 0 SCBs aborted
ahc0: Selection Timeout on A:13. 0 SCBs aborted
ahc0: Selection Timeout on A:14. 0 SCBs aborted
ahc0: Selection Timeout on A:15. 0 SCBs aborted
(probe5:ahc0:0:5:0): error 22
(probe5:ahc0:0:5:0): Unretryable Error
(ahc0:A:4:0): Sending SDTR period c, offset 7f
(probe0:ahc0:0:0:0): Retrying Command
(probe1:ahc0:0:1:0): Retrying Command
(probe2:ahc0:0:2:0): Retrying Command
(ahc0:A:4:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
ahc0: target 4 synchronous at 10.0MHz, offset = 0xf
(ahc0:A:5:0): Sending SDTR period c, offset 7f
(ahc0:A:5:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
ahc0: target 5 synchronous at 10.0MHz, offset = 0xf
(ahc0:A:4:0): Sending SDTR period 19, offset f
(ahc0:A:4:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
(ahc0:A:5:0): Sending SDTR period 19, offset f
(ahc0:A:5:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
(ahc0:A:0:0): Sending WDTR 1
(ahc0:A:0:0): Received WDTR 1 filtered to 1
ahc0: target 0 using 16bit transfers
(ahc0:A:0:0): Sending SDTR period a, offset 7f
(ahc0:A:0:0): Received SDTR period a, offset 3f
	Filtered to period a, offset 3f
ahc0: target 0 synchronous at 40.0MHz, offset = 0x3f
(ahc0:A:1:0): Sending WDTR 1
(ahc0:A:1:0): Received WDTR 1 filtered to 1
ahc0: target 1 using 16bit transfers
(ahc0:A:1:0): Sending SDTR period a, offset 7f
(ahc0:A:1:0): Received SDTR period a, offset 3f
	Filtered to period a, offset 3f
ahc0: target 1 synchronous at 40.0MHz, offset = 0x3f
(ahc0:A:2:0): Sending WDTR 1
(ahc0:A:2:0): Received WDTR 1 filtered to 1
ahc0: target 2 using 16bit transfers
(ahc0:A:2:0): Sending SDTR period a, offset 7f
(ahc0:A:2:0): Received SDTR period a, offset 3f
	Filtered to period a, offset 3f
ahc0: target 2 synchronous at 40.0MHz, offset = 0x3f
sa0 at ahc0 bus 0 target 4 lun 0
sa0: <Seagate STT20000N 6A51> Removable Sequential Access SCSI-2 device 
sa0: Serial Number 
sa0: 10.000MB/s transfers (10.000MHz, offset 15)
pass0 at ahc0 bus 0 target 0 lun 0
pass0: <SEAGATE ST173404LW 0004> Fixed Direct Access SCSI-3 device 
pass0: Serial Number 3CE0JQZE0000712515DX
pass0: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
pass1 at ahc0 bus 0 target 1 lun 0
pass1: <SEAGATE ST173404LW 0004> Fixed Direct Access SCSI-3 device 
pass1: Serial Number 3CE0JRBH00002126H41Y
pass1: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
pass2 at ahc0 bus 0 target 2 lun 0
pass2: <SEAGATE ST373405LW 0003> Fixed Direct Access SCSI-3 device 
pass2: Serial Number 3EK01A9X00007222A71B
pass2: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
pass3 at ahc0 bus 0 target 4 lun 0
pass3: <Seagate STT20000N 6A51> Removable Sequential Access SCSI-2 device 
pass3: Serial Number 
pass3: 10.000MB/s transfers (10.000MHz, offset 15)
pass4 at ahc0 bus 0 target 5 lun 0
pass4: <HP CD-Writer+ 9200 1.0e> Removable CD-ROM SCSI-4 device 
pass4: 10.000MB/s transfers (10.000MHz, offset 15)
(ahc0:A:5:0): Sending SDTR period 19, offset f
(ahc0:A:5:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
(cd0:ahc0:0:5:0): error 6
(cd0:ahc0:0:5:0): Unretryable Error
cd0 at ahc0 bus 0 target 5 lun 0
cd0: <HP CD-Writer+ 9200 1.0e> Removable CD-ROM SCSI-4 device 
cd0: 10.000MB/s transfers (10.000MHz, offset 15)
cd0: Attempt to query device size failed: NOT READY, Medium not present
da2 at ahc0 bus 0 target 2 lun 0
da2: <SEAGATE ST373405LW 0003> Fixed Direct Access SCSI-3 device 
da2: Serial Number 3EK01A9X00007222A71B
da2: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da2: 70007MB (143374741 512 byte sectors: 255H 63S/T 8924C)
da1 at ahc0 bus 0 target 1 lun 0
da1: <SEAGATE ST173404LW 0004> Fixed Direct Access SCSI-3 device 
da1: Serial Number 3CE0JRBH00002126H41Y
da1: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da1: 70007MB (143374738 512 byte sectors: 255H 63S/T 8924C)
da0 at ahc0 bus 0 target 0 lun 0
da0: <SEAGATE ST173404LW 0004> Fixed Direct Access SCSI-3 device 
da0: Serial Number 3CE0JQZE0000712515DX
da0: 80.000MB/s transfers (40.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da0: 70007MB (143374738 512 byte sectors: 255H 63S/T 8924C)
GEOM: new disk cd0
GEOM: new disk da0
GEOM: new disk da1
GEOM: new disk da2
(ahc0:A:5:0): Sending SDTR period 19, offset f
(ahc0:A:5:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
(cd0:ahc0:0:5:0): error 6
(cd0:ahc0:0:5:0): Unretryable Error
(ahc0:A:5:0): Sending SDTR period 19, offset f
(ahc0:A:5:0): Received SDTR period 19, offset f
	Filtered to period 19, offset f
(cd0:ahc0:0:5:0): error 6
(cd0:ahc0:0:5:0): Unretryable Error
Trying to mount root from ufs:/dev/da0s1a
start_init: trying /sbin/init
fxp0: Microcode loaded, int_delay: 1000 usec  bundle_max: 0
fxp0: Microcode loaded, int_delay: 1000 usec  bundle_max: 0

>How-To-Repeat:

Script started on Wed Dec 20 11:40:34 2006
#find . -ls
  4225   4 drwxr-xr-x 3 root wheel    512 Dec 20 11:39 .
  4230   4 drwxr-xr-x 2 root wheel    512 Dec 20 11:39 ./files
  4229 608 -r--r--r-- 1 root wheel 284397 Dec 20 11:39 ./files/f1
  4228 672 -r--r--r-- 1 root wheel 321748 Dec 20 11:39 ./files/f2
  4227 672 -r--r--r-- 1 root wheel 319531 Dec 20 11:39 ./files/f3
  4226 576 -r--r--r-- 1 root wheel 262694 Dec 20 11:39 ./files/f4
#tar -cv files
a files
a files/f1
a files/f2
a files/f3
a files/f4
#tar -tv
drwxr-xr-x  0 root   wheel       0 Dec 20 11:39 files
-r--r--r--  0 root   wheel  284397 Dec 20 11:39 files/f1
tar: Unrecognized archive format: Inappropriate file type or format
#pax -v -f /dev/sa0
drwxr-xr-x  2 root             wheel          0 Dec 20 11:39 files
-r--r--r--  1 root             wheel     284397 Dec 20 11:39 files/f1
-r--r--r--  1 root             wheel     321748 Dec 20 11:39 files/f2
-r--r--r--  1 root             wheel     319531 Dec 20 11:39 files/f3
-r--r--r--  1 root             wheel     262694 Dec 20 11:39 files/f4
pax: Waiting for tape drive close to complete...done.
pax: ustar vol 1, 5 files, 1198080 bytes read, 0 bytes written.
#cat /dev/sa0 > f.tar
cat: /dev/sa0: Input/output error
#cp /dev/sa0 f.tar
#tar -tvf f.tar
drwxr-xr-x  0 root   wheel       0 Dec 20 11:39 files
-r--r--r--  0 root   wheel  284397 Dec 20 11:39 files/f1
-r--r--r--  0 root   wheel  321748 Dec 20 11:39 files/f2
-r--r--r--  0 root   wheel  319531 Dec 20 11:39 files/f3
-r--r--r--  0 root   wheel  262694 Dec 20 11:39 files/f4
#dd if=/dev/sa0 of=f.tar bs=20k

0+117 records in
0+117 records out
1198080 bytes transferred in 3.931864 secs (304710 bytes/sec)
#tar -tvf f.tar
drwxr-xr-x  0 root   wheel       0 Dec 20 11:39 files
-r--r--r--  0 root   wheel  284397 Dec 20 11:39 files/f1
-r--r--r--  0 root   wheel  321748 Dec 20 11:39 files/f2
-r--r--r--  0 root   wheel  319531 Dec 20 11:39 files/f3
-r--r--r--  0 root   wheel  262694 Dec 20 11:39 files/f4
#exit

Script done on Wed Dec 20 11:47:09 2006

>Fix:

	


>Release-Note:
>Audit-Trail:

From: mjacob@freebsd.org
To: Bernd Luevelsmeyer <bdluevel@heitec.net>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Wed, 20 Dec 2006 05:50:56 -0800 (PST)

 Try using tar with a specified blocksize that's equal to the underlying 
 h/w blocksize on the tape.
 

From: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: mjacob@freebsd.org
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Wed, 20 Dec 2006 15:17:41 +0100

 The tape's blocksize is 10 KB, which is tar's default anyway. I tried
 various other blocksizes nevertheless, to no avail; except an error in
 dmesg ("(sa0:ahc0:0:4:0): 10240-byte tape record bigger than supplied
 buffer") for small blocksizes.
 
 Greetings,
 	Bernd

From: mjacob@FreeBSD.org
To: Bernd Luevelsmeyer <bdluevel@heitec.net>
Cc: mjacob@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org,
        freebsd-bugs@FreeBSD.org
Subject: Re: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Thu, 21 Dec 2006 11:48:02 -0800 (PST)

 I'm on vacation at present, but trying to follow this. This particular 
 tape drive is unfamiliar to me. I would assume that it must be some kind 
 of fixed blocksize device.
 
 Despite what you said, could you please try:
 
 mt -f /dev/sa0 seteotmodel 1
 cd /usr/include
 tar cvfb /dev/sa0 1 . || tar tvfb /dev/sa0 1
 mt -f /dev/sa0 rewind
 tar cvfb /dev/sa0 2 . || tar tvfb /dev/sa0 2
 
From: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: mjacob@freebsd.org
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Fri, 22 Dec 2006 11:26:01 +0100

 Sure. I would have expected the eotmodel to be 2, but it appears to have
 been 1 to begin with. In order to keep the mail to a sensible length, I
 deleted most of tar's output and replaced it with "[...]". However, I
 don't quite understand the point of this test, since the "tar c" _does_
 work fine; it's the reading that doesn't work.
 
 Script started on Fri Dec 22 10:37:13 2006
 #mt -f /dev/sa0 seteotmodel 1
 /dev/sa0: old model was 1 filemark at EOT
 /dev/sa0: new model  is 1 filemark at EOT
 #cd /usr/include
 #tar cvfb /dev/sa0 1 . || tar tvfb /dev/sa0 1
 a .
 a a.out.h
 a ar.h
 a assert.h
 a bitstring.h
 [...1571 lines...]
 a bsm/audit.h
 a bsm/audit_kevents.h
 a bsm/audit_internal.h
 a bsm/audit_record.h
 a bsm/audit_uevents.h
 a bsm/libbsm.h
 #mt -f /dev/sa0 rewind
 #tar cvfb /dev/sa0 2 . || tar tvfb /dev/sa0 2
 a .
 a a.out.h
 a ar.h
 a assert.h
 a bitstring.h
 [...1571 lines...]
 a bsm/audit.h
 a bsm/audit_kevents.h
 a bsm/audit_internal.h
 a bsm/audit_record.h
 a bsm/audit_uevents.h
 a bsm/libbsm.h
 #exit
 
 Script done on Fri Dec 22 10:44:49 2006

From: mjacob@freebsd.org
To: Bernd Luevelsmeyer <bdluevel@heitec.net>
Cc: mjacob@freebsd.org, FreeBSD-gnats-submit@freebsd.org,
        freebsd-bugs@freebsd.org
Subject: Re: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Fri, 22 Dec 2006 08:24:37 -0800 (PST)

 I would expect a Travan based drive to be like a QIC tape. From my 
 minimal experience with them, they seem to be derived from QIC standards 
 and probably derive from native QIC-02 starting back 20 odd years ago 
 (like the old Cipher Floppy-Tape drive which had an SA850 interface).
 
 I dunno why tar didn't give a 0 exit on the create, but try again 
 replacing the || with ;
 
 The point here is to try and force 512 and 1024 byte record creation and 
 to force 512 and 1024 byte reads.
  
From: CAdams <salsafresh@yahoo.com>
To: bug-followup@FreeBSD.org, bdluevel@heitec.net
Cc:  
Subject: bin/106973: 'tar' cannot read own tape, but 'pax' can
Date: Thu, 18 Jan 2007 20:50:42 -0800 (PST)

 Exact same problem, with different hardware
 (SDX-900V).  cp and pax read tape created with tar -cf
 /dev/nsa0, tar does not.  Changing blocksize changes
 point where error occurs.  Problem does not occur with
 a 5.4 install.
 
 Here are my results--
 #mt -f /dev/sa0 seteotmodel 1
 /dev/sa0: old model was 1 filemark at EOT
 /dev/sa0: new model is 1 filemark at EOT
 # mt -f /dev/sa0 rewind
 # tar cvfb /dev/sa0 1 . ; tar tvfb /dev/sa0 1
 a .
 a altq
 a arpa
 a bsm
 a bsnmp
 a c++
 a cam
 a crypto
 ...
 a altq/altq_var.h
 a altq/altqconf.h
 a altq/if_altq.h
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 .
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 altq
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 arpa
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 bsm
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 bsnmp
 drwxr-xr-x  0 root   wheel       0 Jan 12 00:38 c++
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 cam
 
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 crypto
 drwxr-xr-x  0 root   wheel       0 Jan 12 00:38 dev
 drwxr-xr-x  0 root   wheel       0 Jan 12 00:38 fs
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 geom
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 gnu
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 gpib
 drwxr-xr-x  0 root   wheel       0 Jan 12 00:38 isofs
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 kadm5
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 libmilter
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 lwres
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 machine
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 net
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 net80211
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netatalk
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 netatm
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netgraph
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netinet
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netinet6
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netipsec
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 netipx
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 netkey
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 netnatm
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 netncp
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 netsmb
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 nfs
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 nfsclient
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 nfsserver
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 objc
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 openssl
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 pccard
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 posix4
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 protocols
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 readline
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 rpc
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 rpcsvc
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39
 security
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 sys
 drwxr-xr-x  0 root   wheel       0 Jan 12 00:38 ufs
 drwxr-xr-x  0 root   wheel       0 Jan 15 05:39 vm
 -r--r--r--  0 root   wheel    2176 Jan 12 00:38
 a.out.h
 -r--r--r--  0 root   wheel    2901 Jan 12 00:38 ar.h
 -r--r--r--  0 root   wheel    2739 Jan 12 00:38
 assert.h
 -r--r--r--  0 root   wheel    1537 Jan 12 00:38
 bitstring.h
 -r--r--r--  0 root   wheel    2107 Jan 12 00:38
 complex.h
 -r--r--r--  0 root   wheel    2466 Jan 12 00:38 cpio.h
 -r--r--r--  0 root   wheel    5547 Jan 12 00:38
 _ctype.h
 -r--r--r--  0 root   wheel    4831 Jan 12 00:38
 ctype.h
 tar: Unrecognized archive format: Inappropriate file
 type or format
 
 # tar cvfb /dev/sa0 2 . ; tar tvfb /dev/sa0 2
 Exact same results as above...
  
 ____________________________________________________________________________________
 No need to miss a message. Get email on-the-go 
 with Yahoo! Mail for Mobile. Get started.
 http://mobile.yahoo.com/mail 

From: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: bug-followup@FreeBSD.org
Cc: Tim Kientzle <kientzle@freebsd.org>
Subject: Re: bin/106973: tar(1) cannot read own tape, but pax(1) can
Date: Wed, 11 Jul 2007 10:36:49 +0200

 This issue came up in the freebsd-stable mailing list. Tim Kientzle
 wrote in <46679117.5060909@freebsd.org> that the SCSI tape driver in 6.2
 claims to be able to do lseek() while in fact it cannot. tar believes it
 and issues lseek() commands, whereupon things go bad. (Apparently, pax
 simply doesn't use lseek() commands, hence has no problems.)
 
 In <4675CD95.9040004@freebsd.org>, he published a patch that prevents
 tar from using lseek() commands. With this patch, tar works just fine
 for me again. However, IMHO this is only a workaround; really, the tape
 driver should not be lying about its capabilities.
 
 Here is the patch:
 
 --- archive_read_open_filename.c        (revision 124)
 +++ archive_read_open_filename.c        (working copy)
 @@ -165,6 +165,15 @@
         struct read_file_data *mine = (struct read_file_data
 *)client_data;
         off_t old_offset, new_offset;
  
 +       /*
 +        * Workaround for broken tape interfaces that don't support
 +        * seek(), but return success if you ask them to seek().  This
 +        * also, of course, slows down archive scanning significantly
 +        * on devices that can seek.  Yuck.
 +        */
 +       if (S_ISCHR(mine->st_mode) || S_ISBLK(mine->st_mode))
 +               return (0);
 +
         /* Reduce request to the next smallest multiple of block_size */
         request = (request / mine->block_size) * mine->block_size;
         /*
 
 I request that the PR's class be changed to kernel (since the error is
 in a driver).
Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 11 10:44:49 UTC 2007 
Responsible-Changed-Why:  
Reclassify.  bsdtar now works around this problem, but it's really a driver 
problem. 

Pointed out by:		submitter 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 
Responsible-Changed-From-To: freebsd-scsi->mjacob 
Responsible-Changed-By: mjacob 
Responsible-Changed-When: Wed Jul 11 15:21:52 UTC 2007 
Responsible-Changed-Why:  
I'll take it long enough to find out where there might be documentation 
that claims that the tape driver supports lseek and kill that as this 
is too bogus to be even worth arguing about. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 
State-Changed-From-To: open->feedback 
State-Changed-By: mjacob 
State-Changed-When: Wed Jul 11 15:25:34 UTC 2007 
State-Changed-Why:  
Please point to the documentation that you claim indicates that tape interfaces 
support the lseek(2) system calPlease point to the documentation that you claim indicates that tape interfaces 
support the lseek(2) system calll 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 

From: Tim Kientzle <tim@kientzle.com>
To: Bernd Luevelsmeyer <bdluevel@heitec.net>
Cc: bug-followup@FreeBSD.org, Tim Kientzle <kientzle@FreeBSD.org>
Subject: Re: bin/106973: tar(1) cannot read own tape, but pax(1) can
Date: Wed, 11 Jul 2007 08:42:39 -0700

 Bernd Luevelsmeyer wrote:
 > This issue came up in the freebsd-stable mailing list. Tim Kientzle
 > wrote in <46679117.5060909@freebsd.org> that the SCSI tape driver in 6.2
 > claims to be able to do lseek() while in fact it cannot.
 
 I've since discussed this with Bruce Evans.  This is not in
 fact a driver issue; lseek() requests are handled generically
 in the kernel without ever involving the driver.  Changing
 this would be complex since it would require changes to
 the device driver API.
 
 > In <4675CD95.9040004@freebsd.org>, he published a patch that prevents
 > tar from using lseek() commands. With this patch, tar works just fine
 > for me again.
 
 The most complete fix is to update libarchive to 6-STABLE,
 which includes fixes for this and many other problems.
 
 > However, IMHO this is only a workaround; really, the tape
 > driver should not be lying about its capabilities.
 > ...
 > I request that the PR's class be changed to kernel (since the error is
 > in a driver).
 
 The error is in fact in the kernel, not the driver,
 and it would be complex to solve.  I'll close
 the PR.
 
 Tim Kientzle
State-Changed-From-To: feedback->closed 
State-Changed-By: mjacob 
State-Changed-When: Wed Jul 11 16:33:07 UTC 2007 
State-Changed-Why:  
Closed at request of submitter 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 

From: Bernd Luevelsmeyer <bdluevel@heitec.net>
To: Matt Jacob <mjacob@FreeBSD.org>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/106973: SCSI tape driver claims to be able to do lseek() while 
 in fact it cannot
Date: Thu, 12 Jul 2007 11:52:55 +0200

 Matt Jacob wrote:
 > 
 > Synopsis: SCSI tape driver claims to be able to do lseek() while in fact it cannot
 > 
 > State-Changed-From-To: feedback->closed
 > State-Changed-By: mjacob
 > State-Changed-When: Wed Jul 11 16:33:07 UTC 2007
 > State-Changed-Why:
 > Closed at request of submitter
 
 It did not request the report to be closed. However, if the issue is
 resolved in libarchive, then that's ok with me.
State-Changed-From-To: closed->open 
State-Changed-By: mjacob 
State-Changed-When: Thu Jul 12 16:49:51 UTC 2007 
State-Changed-Why:  
It was Tim K who wanted this closed, not the submitter. My mistake. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 
Responsible-Changed-From-To: mjacob->kientzle 
Responsible-Changed-By: mjacob 
Responsible-Changed-When: Thu Jul 12 16:51:12 UTC 2007 
Responsible-Changed-Why:  
Reassigning to Tim for disposition. It's definitely not a driver problem 
as tape drivers don't support lseek(2) semantics. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 
State-Changed-From-To: open->closed 
State-Changed-By: kientzle 
State-Changed-When: Fri Jul 13 12:32:53 UTC 2007 
State-Changed-Why:  
The original issue (that 'tar -t' failed on tape 
drives) has been solved by having tar assume that 
only regular files support lseek(). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106973 
>Unformatted:
