Subject: kern/33543: panic on quota
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <dennis@eperm.net>
List: netbsd-bugs
Date: 05/24/2006 12:40:00
>Number:         33543
>Category:       kern
>Synopsis:       panic on quota
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 24 12:40:00 +0000 2006
>Originator:     Dennis Wecker
>Release:        2.0.3
>Organization:
>Environment:
NetBSD sigenv.eperm.net 2.0.3 NetBSD 2.0.3 (GENERIC.MP) #1: Thu Nov  3 09:42:11 CET 2005  root@sigenv.eperm.net:/usr/obj/sys/arch/i386/compile/GENERIC.MP i386
>Description:
enabled quotas by "quota=YES" in /etc/rc.conf.
in /etc/fstab:
/dev/ld0g /home ffs rw,userquota=/var/quotas/home.user,softdep 1 2

root@sigenv# mount | grep home
/dev/ld0g on /home type ffs (soft dependencies, local, with quotas)

after rebooting and 'edquota' for several users:
root@sigenv# repquota -a -v
*** Report for user quotas on /home (/dev/ld0g)
                        Block limits               File limits
User            used    soft    hard  grace      used    soft    hard  grace
root      --    2714       0       0               41       0       0       
dennis    --  756317       0       0           133214       0       0       
www       --   20851       0       0              531       0       0       
user01    --   56376       0 5120000             8178       0       0       
user02    --  295578       0 1024000             2545       0       0       
user03    --  270303       0  307200              226       0       0       
user04    --     166       0   51200               40       0       0       
user05    --  295152       0 5120000              376       0       0       
user06    --   70171       0 1024000             3602       0       0       
user06    --    3265       0 1536000              246       0       0       
user07    --33142199       0       0            21341       0       0       
user08    --   25093       0   51200               60       0       0       
user09    --    3218       0   51200               16       0       0       
user10    --     191       0   51200                3       0       0       
user11    --    1703       0   51200                1       0       0       
user12    --      11       0   51200                5       0       0       
user13    --   76772       0 1024000               90       0       0       
user14    --   37048       0  102400             1564       0       0

that worked for some hours. after that, the machine crashed into db:

uvm_fault(0xcf670614, 0, 0, 2) -> 0xe
kernel: page fault trap, code=0
Stopped in pid 7334.1 (cvs) at  netbsd:dqget+0x35a:    movl    %edx,0(%eax)
db{0}> tr
dqget(d55359c8,3e9,c1e4fc00,0,d57d2898) at netbsd:dqget+0x35a
getinoquota(d57d2844,81a4,c20aa880,cf90cc30,c0607ca0) at netbsd:getinoquota+0x6a

ufs_makeinode(81a4,d1f2a390,cf90cec4,cf90ced8,ce246630) at netbsd:ufs_makeinode+0xb4
ufs_create(cf90cd94,4473b19f,cf90cdcc,c03e1a58,c0607b60) at netbsd:ufs_create+0x26
VOP_CREATE(d1f2a390,cf90cec4,cf90ced8,cf90cdf4,d1f2a390) at netbsd:VOP_CREATE+0x34
vn_open(cf90ceb4,603,1a4,cce696c0,0) at netbsd:vn_open+0x151
sys_open(cce696c0,cf90cf64,cf90cf5c,5,c0394cef) at netbsd:sys_open+0xcb
syscall_plain() at netbsd:syscall_plain+0x17e
--- syscall (number 5) ---
0x4828bf37:
db{0}>

while rebooting after the crash, 'quotacheck' outputs:
quotacheck: bad inode number 224 to nextinode
THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
        ffs: /dev/rld0g (/home)

...fsck is not able to fix that. i tried it with several disks.
>How-To-Repeat:
enable and setup quotas.
>Fix: