Subject: kern/9357: panic: lfs_updatemeta: negative bytes
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jarle@runit.no>
List: netbsd-bugs
Date: 02/05/2000 11:54:16
>Number:         9357
>Category:       kern
>Synopsis:       panic: lfs_updatemeta: negative bytes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb  5 11:51:00 2000
>Last-Modified:
>Originator:     Jarle Greipsland
>Organization:
	
>Release:        2000-02-02
>Environment:
	
System: NetBSD honey.runit.sintef.no 1.4R NetBSD 1.4R (HONEY) #13: Wed Feb 2 12:28:44 CET 2000 jarle@honey.runit.sintef.no:/usr/src/sys/arch/alpha/compile/HONEY alpha


>Description:

# lfs_updatemeta: negative bytes (segment 0 short by 512)
lfs_updatemeta: ino 87, lbn 0, addr = 7fa
panic: lfs_updatemeta: negative bytes
Stopped in lfs_cleanerd at      cpu_Debugger+0x4:       ret     zero,(ra)
db> 
db> ps
 PID             PPID       PGRP        UID S   FLAGS          COMMAND    WAIT
 7578             222       7578          0 3  0x4186              top  select
 7412           27886       7412      16073 3  0x4186           systat   ttyin
 27886          27866      27886      16073 3  0x4086              csh   pause
 27866          27817      27817      16073 3  0x4184            xterm  select
 27817          27769      27817      16073 3  0x4084              csh   pause
 27769            212        212          0 3    0x84            sshd1  select
>How-To-Repeat:
Stress the LFS filesystem.  The panic detailed above occurred shortly
after a bonnie run had finished.
	
>Fix:
	
>Audit-Trail:
>Unformatted:
>14689          14688      14688          0 2     0x4     lfs_cleanerd
 14688              1      14688          0 3    0x84     lfs_cleanerd    wait
 222              221        222          0 3  0x5086             bash    wait
 221              220        221      16073 3  0x4086             bash    wait
 220              217        217      16073 3  0x4184            xterm  select
 217              215        217      16073 3  0x4084              csh   pause
 215              212        212          0 3    0x84            sshd1  select
 214                1        214          0 3  0x4086              csh   ttyin
 212                1        212          0 3    0x84            sshd1  select
 200                1        200          0 3    0x84            inetd  select
 197                1        197          0 3    0x84            xntpd   pause
 195                1        195          0 3   0x184             cron nanosle
 163                1        163          0 3    0x84        mount_mfs  mfsidl
 157                1        157          0 3    0x84          portmap  select
 150                1        150          0 2    0x84          syslogd
 4                  0          0          0 3 0x20204          ioflush  syncer
 3                  0          0          0 3 0x20204           reaper  reaper
 2                  0          0          0 3 0x20204       pagedaemon daemon_
 1                  0          1          0 3  0x4084             init    wait
 0                 -1          0          0 3 0x20204          swapper schedul
db> 
db> trace
cpu_Debugger() at cpu_Debugger+0x4
panic() at panic+0xe4
lfs_updatemeta() at lfs_updatemeta+0x434
lfs_gather() at lfs_gather+0x1c8
lfs_writefile() at lfs_writefile+0x1bc
lfs_writevnodes() at lfs_writevnodes+0x160
lfs_segwrite() at lfs_segwrite+0x140
sys_lfs_markv() at sys_lfs_markv+0x8bc
syscall() at syscall+0x1c8
XentSys() at XentSys+0x50
--- syscall (185, netbsd.sys_lfs_markv) ---
--- user mode ---
db> 

(gdb) xps
              proc   pid     flag st              wchan comm
0xfffffc0004952d98  7578     4186  3 0xfffffc00005b2b60 top (select)
0xfffffc00049521f8  7412     4186  3 0xfffffc0000e18418 systat (ttyin)
0xfffffc00071809c0 27886     4086  3 0xfffffc00063a6018 csh (pause)
0xfffffc00071805e0 27866     4184  3 0xfffffc00005b2b60 xterm (select)
0xfffffc0007180200 27817     4084  3 0xfffffc00068fb630 csh (pause)
0xfffffc00049527c8 27769       84  3 0xfffffc00005b2b60 sshd1 (select)
0xfffffc00049523e8 14689        4  2                  0 lfs_cleanerd (biowait)
0xfffffc0004952ba8 14688       84  3 0xfffffc0004952ba8 lfs_cleanerd (wait)
0xfffffc0004952008   222     5086  3 0xfffffc0004952008 bash (wait)
0xfffffc0000e3bd10   221     4086  3 0xfffffc0000e3bd10 bash (wait)
0xfffffc0000e3b930   220     4184  3 0xfffffc00005b2b60 xterm (select)
0xfffffc0000e3b740   217     4084  3 0xfffffc0003cba8d8 csh (pause)
0xfffffc0000e3af80   215       84  3 0xfffffc00005b2b60 sshd1 (select)
0xfffffc0000e3a7c0   214     4086  3 0xfffffc0000e18010 csh (ttyin)
0xfffffc0000e3bb20   212       84  3 0xfffffc00005b2b60 sshd1 (select)
0xfffffc0000e3b550   200       84  3 0xfffffc00005b2b60 inetd (select)
0xfffffc0000e3b360   197       84  3 0xfffffc0003cba008 xntpd (pause)
0xfffffc0000e3ad90   195      184  3 0xfffffc000058a8c4 cron (nanosleep)
0xfffffc0000e3b170   163       84  3 0xfffffc0002e11df8 mount_mfs (mfsidl)
0xfffffc0000e3aba0   157       84  3 0xfffffc00005b2b60 portmap (select)
0xfffffc0000e3a9b0   150       84  2                  0 syslogd (select)
0xfffffc0000e3a5d0     4    20204  3 0xfffffc00005b2094 ioflush (syncer)
0xfffffc0000e3a3e0     3    20204  3 0xfffffc00005b1c08 reaper (reaper)
0xfffffc0000e3a1f0     2    20204  3 0xfffffc00005ce0c8 pagedaemon (daemon_slp)
0xfffffc0000e3a000     1     4084  3 0xfffffc0000e3a000 init (wait)
0xfffffc00005aef88     0    20204  3 0xfffffc00005aef88 swapper (scheduler)
              proc   pid     flag st              wchan comm

# grep lfs /etc/fstab
/dev/ccd0a /spare lfs rw 1 2

# disklabel ccd0a
# /dev/rccd0a:
type: ccd
disk: ccd
label: default label
flags:
bytes/sector: 512
sectors/track: 2048
tracks/cylinder: 1
sectors/cylinder: 2048
cylinders: 12272
total sectors: 25133460
rpm: 5400
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

8 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a: 25133056        0     4.4LFS     1024  8192     0   # (Cyl.    0 - 12271)
  c: 25133460        0     unused        0     0         # (Cyl.    0 - 12272*)