On Saturday 28 January 2012, Daniele Pilenga wrote: > >Synopsis: Kernel panics trying to create a softraid crypto disk on a > > 4K/sec drive > > >Category: Kernel bugs, softraid > >Environment: > > System : OpenBSD 5.1 > Details : OpenBSD 5.1-beta (GENERIC) #163: Thu Jan 26 15:59:48 MST > 2012 > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC > > Architecture: OpenBSD.amd64 > Machine : amd64 > > >Description: > > I have an external USB drive of 1TB with 4K sectors. > Trying to create a softraid crypto device on it causes the kernel to > panic.
Thanks for the report - softraid(4) does not currently support devices that have a sector size that is not 512 bytes. I've just commited a diff that causes this condition to be detected, meaning that you get an error instead of a panic. > >How-To-Repeat: > > Plug the drive in. Kernel reports: > > umass0 at uhub3 port 1 configuration 1 interface 0 "Iomega eGo USB" rev > 2.10/0.00 addr 3 > umass0: using SCSI over Bulk-Only > scsibus3 at umass0: 2 targets, initiator 0 > sd1 at scsibus3 targ 1 lun 0: <OEM, Ext Hard Disk, 0000> SCSI3 0/direct > fixed > sd1: 953169MB, 4096 bytes/sector, 244011446 sectors > cd1 at scsibus3 targ 1 lun 1: <Virtual, CDROM, > SCSI0 5/cdrom fixed > > # disklabel sd1 > > # /dev/rsd1c: > type: SCSI > disk: SCSI disk > label: Ext Hard Disk > duid: 8781a249b30119d4 > flags: > bytes/sector: 4096 > sectors/track: 63 > tracks/cylinder: 255 > sectors/cylinder: 16065 > cylinders: 15189 > total sectors: 244011446 > boundstart: 256 > boundend: 51200256 > drivedata: 0 > > 16 partitions: > # size offset fstype [fsize bsize cpg] > c: 244011446 0 unused > d: 51200000 256 RAID > > # bioctl -c C -l /dev/sd1d softraid0 > > sd2 at scsibus2 targ1 lun 0: <OPENBSD, SR CRYPTO, 005> SCSI2 0/direct fixed > sd2: 24999MB, 512 bytes/sector, 51199472 sectors > softraid0: i/o error on block 528 > panic: softraid0: sr_crypto_finish_io > Stopped at Debugger+0x5: leave > RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC! > DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION! > ddb> trace > Debugger() at Debugger+0x5 > panic() at panic+0xe4 > sr_crypto_finish_io() at sr_crypto_finish_io+0xc3 > sr_crypto_intr() at sr_crypto_intr+0x15e > sdstrategy() at sdstrategy+0x11b > spec_strategy() at spec_strategy+0x54 > VOP_STRATEGY() at VOP_STRATEGY+0x2e > sr_startwu_callback() at sr_startwu_callback+0x49 > workq_thread() at workq_thread+0x33 > end trace frame: 0x0, count: -9 > ddb> ps > PID PPID PGRP UID S FLAGS WAIT COMMAND > * 7692 0 0 0 7 0x100200 srdis > 17129 32448 17129 0 3 0 biowait bioctl > 32448 1 32448 0 3 0x88 pause ksh > 14 0 0 0 3 0x100200 aiodoned aiodoned > 13 0 0 0 3 0x100200 syncer update > 12 0 0 0 3 0x100200 cleaner cleaner > 11 0 0 0 3 0x100200 reaper reaper > 10 0 0 0 3 0x100200 pgdaemon pagedaemon > 9 0 0 0 3 0x100200 bored crypto > 8 0 0 0 3 0x100200 pftm pfpurge > 7 0 0 0 3 0x100200 mmctsk sdmmc0 > 6 0 0 0 3 0x100200 usbtsk usbtask > 5 0 0 0 3 0x100200 usbatsk usbatsk > 4 0 0 0 3 0x100200 acpi0 acpi0 > 3 0 0 0 3 0x100200 biowait syswq > 2 0 0 0 3 0x40100200 idle0 > 1 0 1 0 3 0x80 wait init > 0 -1 0 0 3 0x200 scheduler swapper > ddb> > > I have hand copied the panic, been this a laptop without serial access. > To reduce > at minimum the output (and the errors) I have booted bsd.sp and issued > a 'shutdown now' > before the procedure; it seems to me the error is the same with a full > system running > SMP. > Please let me know if you think I have made any mistakes. > > >Fix: > > Unknown. > I think this is related to the 4K sized sectors of the disk that > confuses softraid. It reports > correctly the sectors count, but calculate the partition size as 8 > times smaller. > > dmesg: > OpenBSD 5.1-beta (GENERIC) #163: Thu Jan 26 15:59:48 MST 2012 > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC > real mem = 4146987008 (3954MB) > avail mem = 4022468608 (3836MB) > mainbus0 at root > bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xf0530 (53 entries) > bios0: vendor Dell Inc. version "A12" date 03/30/2011 > bios0: Dell Inc. Studio 1558 > acpi0 at bios0: rev 2 > acpi0: sleep states S0 S3 S4 S5 > acpi0: tables DSDT FACP HPET MCFG APIC BOOT SPCR SLIC OSFR ASF! SSDT > acpi0: wakeup devices P0P2(S4) P0P1(S4) EHC1(S3) PXSX(S4) RP01(S4) PXSX(S4) > RP02(S4) PXSX(S4) RP04(S3) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4) LID0(S3) > acpitimer0 at acpi0: 3579545 Hz, 24 bits > acpihpet0 at acpi0: 14318179 Hz > acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255 > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat > cpu0 at mainbus0: apid 0 (boot processor) > cpu0: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz, 2394.35 MHz > cpu0: > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFL >USH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX >,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF cpu0: > 256KB 64b/line 8-way L2 cache > cpu0: apic clock running at 133MHz > cpu at mainbus0: not configured > cpu at mainbus0: not configured > cpu at mainbus0: not configured > ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins > acpiprt0 at acpi0: bus 0 (PCI0) > acpiprt1 at acpi0: bus 2 (P0P2) > acpiprt2 at acpi0: bus 10 (P0P1) > acpiprt3 at acpi0: bus 3 (RP01) > acpiprt4 at acpi0: bus 4 (RP02) > acpiprt5 at acpi0: bus 5 (RP04) > acpiprt6 at acpi0: bus 7 (RP05) > acpiprt7 at acpi0: bus 9 (RP06) > acpiec0 at acpi0 > acpicpu0 at acpi0: C3, C1, PSS > acpipwrres0 at acpi0: FN00 > acpipwrres1 at acpi0: FN01 > acpitz0 at acpi0: critical temperature is 100 degC > acpitz1 at acpi0acpitz1: TZ01: failed to read _TMP > acpibtn0 at acpi0: PWRB > acpibtn1 at acpi0: SLPB > acpibtn2 at acpi0: LID0 > acpiac0 at acpi0: AC unit online > acpibat0 at acpi0: BAT0 model "Dell" serial 40905 type LION oem "SDI" > acpivideo0 at acpi0: M86_ > acpivideo1 at acpi0: GFX0 > cpu0: Enhanced SpeedStep 2394 MHz: speeds: 2400, 2399, 2266, 2133, 1999, > 1866, 1733, 1599, 1466, 1333, 1199 MHz > pci0 at mainbus0 bus 0 > mem address conflict 0xf0b04000/0x1000 > pchb0 at pci0 dev 0 function 0 "Intel Core Host" rev 0x12 > ppb0 at pci0 dev 1 function 0 "Intel 3400 PCIE" rev 0x12: msi > pci1 at ppb0 bus 2 > vga1 at pci1 dev 0 function 0 "ATI Mobility Radeon HD 4500" rev 0x00 > wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) > wsdisplay0: screen 1-5 added (80x25, vt100 emulation) > radeondrm0 at vga1: apic 2 int 16 > drm0 at radeondrm0 > azalia0 at pci1 dev 0 function 1 "ATI Radeon HD 4000 HD Audio" rev 0x00: > msi azalia0: no supported codecs > "Intel 3400 MEI" rev 0x06 at pci0 dev 22 function 0 not configured > ehci0 at pci0 dev 26 function 0 "Intel 3400 USB" rev 0x06: apic 2 int 16 > usb0 at ehci0: USB revision 2.0 > uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1 > azalia1 at pci0 dev 27 function 0 "Intel 3400 HD Audio" rev 0x06: msi > azalia1: codecs: IDT 92HD73C1 > audio0 at azalia1 > ppb1 at pci0 dev 28 function 0 "Intel 3400 PCIE" rev 0x06: msi > pci2 at ppb1 bus 3 > ppb2 at pci0 dev 28 function 1 "Intel 3400 PCIE" rev 0x06: msi > pci3 at ppb2 bus 4 > iwn0 at pci3 dev 0 function 0 "Intel Centrino Advanced-N 6200" rev 0x35: > msi, MIMO 2T2R, MoW, address 00:23:14:13:b8:00 > ppb3 at pci0 dev 28 function 3 "Intel 3400 PCIE" rev 0x06: msi > pci4 at ppb3 bus 5 > ppb4 at pci0 dev 28 function 4 "Intel 3400 PCIE" rev 0x06: msi > pci5 at ppb4 bus 7 > sdhc0 at pci5 dev 0 function 0 "Ricoh 5U822 SD/MMC" rev 0x01: apic 2 int 16 > sdmmc0 at sdhc0 > "Ricoh 5U230 Memory Stick" rev 0x01 at pci5 dev 0 function 1 not configured > "Ricoh 5U852 SD/MMC" rev 0x01 at pci5 dev 0 function 2 not configured > "Ricoh 5U832 Firewire" rev 0x01 at pci5 dev 0 function 3 not configured > ppb5 at pci0 dev 28 function 5 "Intel 3400 PCIE" rev 0x06: msi > pci6 at ppb5 bus 9 > re0 at pci6 dev 0 function 0 "Realtek 8168" rev 0x03: RTL8168D/8111D > (0x2800), apic 2 int 17, address 00:26:b9:1b:70:3d > rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 2 > ehci1 at pci0 dev 29 function 0 "Intel 3400 USB" rev 0x06: apic 2 int 23 > usb1 at ehci1: USB revision 2.0 > uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1 > ppb6 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xa6 > pci7 at ppb6 bus 10 > pcib0 at pci0 dev 31 function 0 "Intel HM55 LPC" rev 0x06 > ahci0 at pci0 dev 31 function 2 "Intel 3400 AHCI" rev 0x06: msi, AHCI 1.3 > scsibus0 at ahci0: 32 targets > sd0 at scsibus0 targ 0 lun 0: <ATA, SAMSUNG HM500JI, 2AC1> SCSI3 0/direct > fixed naa.50024e92019d4a11 > sd0: 476940MB, 512 bytes/sector, 976773168 sectors > cd0 at scsibus0 targ 1 lun 0: <TSSTcorp, DVD+-RW TS-T633C, D700> ATAPI > 5/cdrom removable > ichiic0 at pci0 dev 31 function 3 "Intel 3400 SMBus" rev 0x06: apic 2 int > 18 iic0 at ichiic0 > lisa0 at iic0 addr 0x1d: lis331dl > spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-10600 SO-DIMM > spdmem1 at iic0 addr 0x52: 2GB DDR3 SDRAM PC3-10600 SO-DIMM > itherm0 at pci0 dev 31 function 6 "Intel 3400 Thermal" rev 0x06 > isa0 at pcib0 > isadma0 at isa0 > pckbc0 at isa0 port 0x60/5 > pckbd0 at pckbc0 (kbd slot) > pckbc0: using irq 1 for kbd slot > wskbd0 at pckbd0: console keyboard, using wsdisplay0 > pms0 at pckbc0 (aux slot) > pckbc0: using irq 12 for aux slot > wsmouse0 at pms0 mux 0 > pms0: Synaptics touchpad, firmware 7.2 > pcppi0 at isa0 port 0x61 > spkr0 at pcppi0 > mtrr: Pentium Pro MTRR support > uhub2 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2 > uvideo0 at uhub2 port 4 configuration 1 interface 0 "CN07RGXF724879BP08ER > Laptop_Integrated_Webcam_2M" rev 2.00/95.12 addr 3 > video0 at uvideo0 > uhub3 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2 > vscsi0 at root > scsibus1 at vscsi0: 256 targets > softraid0 at root > scsibus2 at softraid0: 256 targets > root on sd0a (fcb304e86eb060a7.a) swap on sd0b dump on sd0b > umass0 at uhub3 port 1 configuration 1 interface 0 "Iomega eGo USB" rev > 2.10/0.00 addr 3 > umass0: using SCSI over Bulk-Only > scsibus3 at umass0: 2 targets, initiator 0 > sd1 at scsibus3 targ 1 lun 0: <OEM, Ext Hard Disk, 0000> SCSI3 0/direct > fixed > sd1: 953169MB, 4096 bytes/sector, 244011446 sectors > cd1 at scsibus3 targ 1 lun 1: <Virtual, CDROM, > SCSI0 5/cdrom fixed -- "Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." -- Ayn Rand
