Subject: kern/6495: ext2fs dies under find load, fsck can't fix
To: None <gnats-bugs@gnats.netbsd.org>
From: Michael Richardson <mcr@solidum.com>
List: netbsd-bugs
Date: 11/21/1998 03:47:17
>Number:         6495
>Category:       kern
>Synopsis:       ext2fs file systems die under /etc/daily, but fsck can't fix
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 24 12:05:01 1998
>Last-Modified:
>Originator:     Michael Richardson
>Organization:
Solidum Systems Corporation
>Release:        NetBSD-current October 31, 1998
>Environment:
	
System: NetBSD gregarin.solidum.com 1.3H NetBSD 1.3H (GREGARIN) #0: Thu Nov 5 17:28:48 EST 1998 mcr@gregarin.solidum.com:/usr/src/sys/arch/i386/compile/GREGARIN i386


>Description:
Nov 21 03:15:00 gregarin CRON[687]: (root) CMD (/bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`/bin/hostname` daily output" root) 
panic: lockmgr: pid 193, not exclusive lock holder 698 unlocking
Stopped in update at    _Debugger+0x4:  leave
db> trace
_Debugger(f30c7a00,0,f3082ec8,f016f02f,f016ebc7) at _Debugger+0x4
_panic(f016ebc7,c1,f016ebb1,2ba,f3035000) at _panic+0x55
_lockmgr(f30c7a00,6,f303508c,f3082f18,f02382ca) at _lockmgr+0x3fb
_ufs_unlock(f3082f04) at _ufs_unlock+0x25
_ext2fs_sync(f04d7800,2,f04c1b00,f2f96604,f04d7800) at _ext2fs_sync+0xf2
_sys_sync(f2f96604,f3082f88,f3082f80,0,efbfdde4) at _sys_sync+0x5c
_syscall() at _syscall+0x1fa
--- syscall (number 36) ---
0x4003d84b:
db> 

db> reboot
syncing disks... 5 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 giving up
rebooting...

LILO boot: 
Loading netbsd

>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted:
>> NetBSD/i386 BIOS Boot, Revision 2.4
>> (root@gregarin.solidum.com, Thu Nov  5 16:11:39 EST 1998)
>> Memory: 639/31744 k
Use hd1a:netbsd to boot sd0 when wd0 is also installed
Press return to boot now, any other key for boot menu
booting wd0a:netbsd - starting in 0
type "?" or "help" for help.
> boot
booting wd0a:netbsd
old BSD partition ID!
[ preserving 299436 bytes of netbsd symbol table ]
Copyright (c) 1996, 1997, 1998
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.3H (GREGARIN) #0: Thu Nov  5 17:28:48 EST 1998
    mcr@gregarin.solidum.com:/usr/src/sys/arch/i386/compile/GREGARIN
cpu0: family 5 model 8 step 0
cpu0: AMD K6-3D (586-class)
real mem  = 33161216
avail mem = 27648000
using 430 buffers containing 1761280 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: Acer Labs M1541 Host-PCI Bridge (rev. 0x04)
ppb0 at pci0 dev 1 function 0: Acer Labs product 0x5243 (rev. 0x04)
pci1 at ppb0 bus 1
pci1: i/o enabled, memory enabled
ohci0 at pci0 dev 2 function 0: Acer Labs M5237 USB Host Controller (rev. 0x03)
pci_intr_map: no mapping for pin A
ohci0: couldn't map interrupt
pcib0 at pci0 dev 7 function 0
pcib0: Acer Labs M1543 PCI-ISA Bridge (rev. 0xc3)
le0 at pci0 dev 14 function 0: PCnet-PCI Ethernet
le0: address 00:00:1a:18:2b:7c
le0: 8 receive buffers, 2 transmit buffers
le0: interrupting at irq 11
Acer Labs M5229 UDMA IDE Controller (IDE mass storage, interface 0xfa, revision 0xc1) at pci0 dev 15 function 0 not configured
VIA Technologies product 0x3043 (ethernet network, revision 0x06) at pci0 dev 18 function 0 not configured
ATI Technologies product 0x4755 (VGA display, revision 0x9a) at pci0 dev 20 function 0 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
lpt0 at isa0 port 0x378-0x37b irq 7
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 channel 0 drive 0: <FUJITSU MPC3032AT>
wd0: using 16-sector pio transfers, lba mode
wd0: 3093MB, 6704 cyl, 15 head, 63 sec, 512 bytes/sect x 6335280 sectors
wd0: using 32-bits pio transfers
wd0: PIO mode 4, DMA mode 2, UDMA mode 2
wdc1 at isa0 port 0x170-0x177 irq 15
atapibus0 at wdc1 channel 0
cd0 at atapibus0 drive 1: <MATSHITA CR-588, , LS13> type 5 cdrom removable
cd0: using 32-bits pio transfers
cd0: PIO mode 4, DMA mode 2
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
pc0 at isa0 port 0x60-0x6f irq 1: color
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
biomask c040 netmask c840 ttymask c8c2
WARNING: old BSD partition ID!
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
swapctl: adding /dev/wd0b as swap device at priority 0
Automatic boot in progress: starting file system checks.
/dev/rwd0a: UNREF FILE I=16145  OWNER=root MODE=100644
/dev/rwd0a: SIZE=0 MTIME=Nov 21 08:15 1998  (CLEARED)
/dev/rwd0a: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/rwd0a: BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/rwd0a: SUMMARY INFORMATION BAD (SALVAGED)
/dev/rwd0a: 940 files, 23153 used, 61331 free (75 frags, 7657 blocks, 0.1% fragmentation)
/dev/rwd0a: MARKING FILE SYSTEM CLEAN
/dev/rwd0e: 22096 files, 299456 used, 506110 free (12078 frags, 61754 blocks, 1.5% fragmentation)
/dev/rwd0e: MARKING FILE SYSTEM CLEAN
CANNOT READ: BLK 52492
/dev/rwd0f: UNEXPECTED INCONSISTENCY; RUN fsck_ext2fs MANUALLY.
CANNOT READ: BLK 1185396
/dev/rwd0g: UNEXPECTED INCONSISTENCY; RUN fsck_ext2fs MANUALLY.
/dev/rwd0h: 2585 files, 578704 free (36169 clusters)
THE FOLLOWING FILE SYSTEMS HAD AN UNEXPECTED INCONSISTENCY:
        ext2fs: /dev/rwd0f (/emul/linux), ext2fs: /dev/rwd0g (/emul/linux/usr)
Automatic file system check failed; help!
Enter pathname of shell or RETURN for sh: 
# fsck
** /dev/rwd0a
** File system is clean; not checking
** /dev/rwd0e
** File system is clean; not checking
** /dev/rwd0f
** Phase 1 - Check Blocks and Sizes

CANNOT READ: BLK 52492
CONTINUE? [yn] n

Program terminated
# reboot
syncing disks... done
rebooting...

LILO boot: linux 
Loading linux.........
[Linux doesn't have a serial console]

...
[root@gregarin mcr]# fdisk /dev/hda

Command (m for help): p

Disk /dev/hda: 128 heads, 63 sectors, 785 cylinders
Units = cylinders of 8064 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      261  1052320+  a5  BSD/386
/dev/hda2   *      262      262      465   822528    6  DOS 16-bit >=32M
/dev/hda3          466      466      785  1290240    5  Extended
/dev/hda5          466      466      478    52384+  83  Linux native
/dev/hda6          479      479      491    52384+  82  Linux swap
/dev/hda7          492      492      785  1185376+  83  Linux native

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): p

Disk /dev/hda: 128 heads, 63 sectors, 785 cylinders
Units = sectors of 1 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1           63       63  2104703  1052320+  a5  BSD/386
/dev/hda2   *  2104704  2104704  3749759   822528    6  DOS 16-bit >=32M
/dev/hda3      3749760  3749760  6330239  1290240    5  Extended
/dev/hda5      3749823  3749823  3854591    52384+  83  Linux native
/dev/hda6      3854655  3854655  3959423    52384+  82  Linux swap
/dev/hda7      3959487  3959487  6330239  1185376+  83  Linux native

Command (m for help): 
Command (m for help): q
[root@gregarin mcr]# uname 
Linux
[root@gregarin mcr]# uname -a
Linux gregarin 2.0.35 #6 Fri Aug 21 12:57:38 EDT 1998 i586 unknown
[root@gregarin mcr]# 
[root@gregarin mcr]# reboot

[back to serial console]
LILO boot: netbsd
Loading netbsd

>> NetBSD/i386 BIOS Boot, Revision 2.4
>> (root@gregarin.solidum.com, Thu Nov  5 16:11:39 EST 1998)
>> Memory: 639/31744 k
Use hd1a:netbsd to boot sd0 when wd0 is also installed
Press return to boot now, any other key for boot menu
booting wd0a:netbsd - starting in 0
old BSD partition ID!
[ preserving 299436 bytes of netbsd symbol table ]
Copyright (c) 1996, 1997, 1998
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.3H (GREGARIN) #0: Thu Nov  5 17:28:48 EST 1998
    mcr@gregarin.solidum.com:/usr/src/sys/arch/i386/compile/GREGARIN
cpu0: family 5 model 8 step 0
cpu0: AMD K6-3D (586-class)
real mem  = 33161216
avail mem = 27648000
using 430 buffers containing 1761280 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: Acer Labs M1541 Host-PCI Bridge (rev. 0x04)
ppb0 at pci0 dev 1 function 0: Acer Labs product 0x5243 (rev. 0x04)
pci1 at ppb0 bus 1
pci1: i/o enabled, memory enabled
ohci0 at pci0 dev 2 function 0: Acer Labs M5237 USB Host Controller (rev. 0x03)
pci_intr_map: no mapping for pin A
ohci0: couldn't map interrupt
pcib0 at pci0 dev 7 function 0
pcib0: Acer Labs M1543 PCI-ISA Bridge (rev. 0xc3)
le0 at pci0 dev 14 function 0: PCnet-PCI Ethernet
le0: address 00:00:1a:18:2b:7c
le0: 8 receive buffers, 2 transmit buffers
le0: interrupting at irq 11
Acer Labs M5229 UDMA IDE Controller (IDE mass storage, interface 0xfa, revision 0xc1) at pci0 dev 15 function 0 not configured
VIA Technologies product 0x3043 (ethernet network, revision 0x06) at pci0 dev 18 function 0 not configured
ATI Technologies product 0x4755 (VGA display, revision 0x9a) at pci0 dev 20 function 0 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
lpt0 at isa0 port 0x378-0x37b irq 7
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 channel 0 drive 0: <FUJITSU MPC3032AT>
wd0: using 16-sector pio transfers, lba mode
wd0: 3093MB, 6704 cyl, 15 head, 63 sec, 512 bytes/sect x 6335280 sectors
wd0: using 32-bits pio transfers
wd0: PIO mode 4, DMA mode 2, UDMA mode 2
wdc1 at isa0 port 0x170-0x177 irq 15
atapibus0 at wdc1 channel 0
cd0 at atapibus0 drive 1: <MATSHITA CR-588, , LS13> type 5 cdrom removable
cd0: using 32-bits pio transfers
cd0: PIO mode 4, DMA mode 2
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
pc0 at isa0 port 0x60-0x6f irq 1: color
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
biomask c040 netmask c840 ttymask c8c2
WARNING: old BSD partition ID!
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
swapctl: adding /dev/wd0b as swap device at priority 0
Automatic boot in progress: starting file system checks.
/dev/rwd0a: file system is clean; not checking
/dev/rwd0e: file system is clean; not checking
/dev/rwd0f: file system is clean; not checking
/dev/rwd0g: file system is clean; not checking
/dev/rwd0h: 2585 files, 578704 free (36169 clusters)
setting tty flags
starting network
hostname: gregarin.solidum.com
configuring network interfaces: le0.
add net default: gateway 192.168.33.13
adding interface aliases:
install: unknown group utmp
starting system logger
checking for core dump...
Nov 21 03:39:35 gregarin syslogd: restart
Nov 21 03:39:35 gregarin syslogd: /var/run/utmp: No such file or directory
savecore: no core dump
starting rpc daemons: portmap.
starting nfs daemons:Nov 21 03:39:37 gregarin last message repeated 56 times
Nov 21 03:39:36 gregarin savecore: no core dump
Nov 21 03:39:37 gregarin syslogd: /var/run/utmp: No such file or directory
 amd.
creating runtime link editor directory cache.
Nov 21 03:39:37 gregarin amd[163]: NIS domain name is not set.  NIS ignored.
Nov 21 03:39:37 gregarin syslogd: /var/run/utmp: No such file or directory
checking quotas: done.
building databases...
clearing /tmp
updating motd.
standard daemons: update cron.
starting network daemons: inetd.
starting local daemons: sshd.
Nov 21 03:39:39 gregarin sshd[236]: log: Server listening on port 22.
Nov 21 03:39:39 gregarin sshd[236]: log: Generating 768 bit RSA key.
Sat Nov 21 03:39:39 EST 1998
Nov 21 03:39:40 gregarin sshd[236]: log: RSA key generation complete.

NetBSD/i386 (gregarin.solidum.com) (tty00)
..

gregarin-[~] root 1 #disklabel wd0
# /dev/rwd0d:
type: ST506
disk: mydisk
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 15
sectors/cylinder: 945
cylinders: 6704
total sectors: 6335280
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   174762       63      4.2BSD     1024  8192    16   # (Cyl.    0*- 184*)
  b:   263655   174825        swap                        # (Cyl.  185 - 463)
  c:  2104641       63      unused        0     0         # (Cyl.    0*- 2227*)
  d:  6335280        0      unused        0     0         # (Cyl.    0 - 6703)
  e:  1666224   438480      4.2BSD     1024  8192    16   # (Cyl.  464 - 2227*)
  f:    52384  3749823     unknown                        # (Cyl. 3968*- 4023*)
  g:  1185376  3959487     unknown                        # (Cyl. 4189*- 5444*)
  h:  1645056  2104704       MSDOS                        # (Cyl. 2227*- 3967*)

... [from above]
 
   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1           63       63  2104703  1052320+  a5  BSD/386
/dev/hda2   *  2104704  2104704  3749759   822528    6  DOS 16-bit >=32M
/dev/hda3      3749760  3749760  6330239  1290240    5  Extended
/dev/hda5      3749823  3749823  3854591    52384+  83  Linux native
/dev/hda6      3854655  3854655  3959423    52384+  82  Linux swap
/dev/hda7      3959487  3959487  6330239  1185376+  83  Linux native

  [I just noticed that my h-partition was *WRONG*. I think I imported it
with sysinst, but I'm not certain anymore. The blocks that it can't read
appear to be "beyond" the end of the partition. Not that far beyond though.
Linux partitions in extended partitions start one track (not cylinder) beyond
the beginnging of the cylinder]