Subject: panic: getblk: block size invariant failed
To: None <netbsd-help@netbsd.org, port-i386@netbsd.org>
From: Scott Presnell <srp@zgi.com>
List: port-i386
Date: 09/05/1999 17:42:16
Hi Folks,
	With upgrading to 1.4/1.4.1 one of my machines has now started
failing in getblk() with the above panic.  This happens around the time
savecore is called in /etc/rc.
If I compile without DIAGNOSTICS, everything seems to work fine...

The only disk in the machine is:

wd0 at wdc0 channel 0 drive 0: <QUANTUM LPS420A-2>
wd0: drive supports 8-sector pio transfers, chs addressing
wd0: 402MB, 1010 cyl, 16 head, 51 sec, 512 bytes/sect x 824160 sectors
wd0: drive supports PIO mode 3, DMA mode 1

The relevant code in kern/vfs_bio.c is :

                if (!ISSET(bp->b_flags, B_INVAL)) {
#ifdef DIAGNOSTIC
                        if (ISSET(bp->b_flags, B_DONE|B_DELWRI) &&
                            bp->b_bcount < size)
                                panic("getblk: block size invariant failed");
#endif
                        SET(bp->b_flags, B_BUSY);
                        bremfree(bp);
                        splx(s);
                        break;
                }
                splx(s);
        }

Why is this happing?

	Thanks.

	- Scott

(here's the rest of the dmesg)

NetBSD 1.4.1 (RHONE) #6: Sun Sep  5 16:38:02 PDT 1999
    srp@srp1.olywa.net:/usr/src/sys/arch/i386/compile/RHONE
cpu0: family 4 model 7 step 0
cpu0: Intel 486DX2 W/B Enhanced (486-class)
real mem  = 16384000
avail mem = 13574144
using 225 buffers containing 921600 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o enabled, memory enabled
Compaq Triflex Host-PCI Bridge (miscellaneous prehistoric) at pci0 dev 0
function 0 not configured
vga1 at pci0 dev 10 function 0: Cirrus Logic CL-GD5434-8 (rev. 0x8e)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 15 function 0
pcib0: Compaq PCI-ISA Bridge (rev. 0x02)
isa0 at pcib0
ep0 at isa0 port 0x300-0x30f irq 10: 3Com 3C509 Ethernet
ep0: address 00:10:5a:25:9f:f6, 8KB byte-wide FIFO, 5:3 Rx:Tx split
ep0: 10baseT (default 10baseT)
ep1 at isa0 port 0x360-0x36f irq 11: 3Com 3C509 Ethernet
ep1: address 00:60:97:05:e2:e2, 8KB byte-wide FIFO, 5:3 Rx:Tx split
ep1: 10baseT (default 10baseT)
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 channel 0 drive 0: <QUANTUM LPS420A-2>
wd0: drive supports 8-sector pio transfers, chs addressing
wd0: 402MB, 1010 cyl, 16 head, 51 sec, 512 bytes/sect x 824160 sectors
wd0: drive supports PIO mode 3, DMA mode 1
lpt0 at isa0 port 0x378-0x37b irq 7
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
sysbeep0 at pcppi0
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
biomask 4040 netmask 4c40 ttymask 4cc2
wscons: wskbd0 glued to wsdisplay0 (console)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
IP Filter: initialized.  Default = pass all, Logging = enabled