NetBSD Problem Report #33060
From Manuel.Bouyer@lip6.fr Sat Mar 11 15:24:45 2006
Return-Path: <Manuel.Bouyer@lip6.fr>
Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2])
by narn.netbsd.org (Postfix) with ESMTP id 193D963B863
for <gnats-bugs@gnats.NetBSD.org>; Sat, 11 Mar 2006 15:24:44 +0000 (UTC)
Message-Id: <200603111524.k2BFOgmk016485@asim.lip6.fr>
Date: Sat, 11 Mar 2006 16:24:42 +0100 (MET)
From: Manuel Bouyer <Manuel.Bouyer@lip6.fr>
Reply-To: Manuel.Bouyer@lip6.fr
To: gnats-bugs@netbsd.org
Subject: another vnlock deadlock
X-Send-Pr-Version: 3.95
>Number: 33060
>Category: kern
>Synopsis: another vnlock deadlock
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 11 15:25:00 +0000 2006
>Closed-Date: Sat May 06 12:20:41 +0000 2006
>Last-Modified: Sat May 06 12:20:41 +0000 2006
>Originator: Manuel Bouyer
>Release: NetBSD 3.0_STABLE
>Organization:
LIP6/ASIM
>Environment:
System: NetBSD asim.lip6.fr 3.0_STABLE NetBSD 3.0_STABLE (ASIM) #4: Mon Jan 30 12:09:32 MET 2006 bouyer@asim.lip6.fr:/usr/src/src/sys/arch/i386/compile/ASIM i386
Architecture: i386
Machine: i386
>Description:
I got another vnlock deadlock on another server. I think it's
different from the ones previsouly reported because this system isn't
SMP, and it happened while a dump -X was running. I suspect a locking
issue in fss(4), I have a core dump available if someone wants to
help me to look at this.
I think this happened on another system without nullfs mounts but
where I was also running dump -X. The result was the same ("proc -
table is full") but I'm not the one who rebooted it so I didn't
have a chance to look at the processes in ddb.
>How-To-Repeat:
run dump -X on an active filesystem ?
>Fix:
please :)
>Release-Note:
>Audit-Trail:
From: Chuck Silvers <chuq@chuq.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: kern/33060: another vnlock deadlock
Date: Tue, 14 Mar 2006 07:04:07 -0800
the problem is a deadlock between these two threads:
0 23150 -1111682260 0 -6 0 200 0 fsslock RW ? 0:00.00 (dump) ce1a4000
(gdb) pcb 0xce1a4000
(gdb) bt
#0 0xcf9eb974 in ?? ()
#1 0xc02362d3 in bpendtsleep () at ../../../../kern/kern_synch.c:508
#2 0xc020d554 in fss_ioctl (dev=41728, cmd=2148033640,
data=0xce1a7c74 "\004", flag=1, p=0xd0ad21a8) at ../../../../dev/fss.c:278
#3 0xc0277e17 in spec_open (v=0xce1a7ce4) at ../../../../sys/proc.h:388
#4 0xc02717e1 in vn_open (ndp=0xce1a7eb4, fmode=3, cmode=0)
at ../../../../sys/vnode_if.h:212
#5 0xc026b43b in sys_open (l=0xcf9eb974, v=0xce1a7f64, retval=0xce1a7f5c)
at ../../../../kern/vfs_syscalls.c:1159
#6 0xc02add87 in syscall_plain (frame=0xce1a7fa8)
at ../../../../arch/i386/i386/syscall.c:161
0 9461 -1111682260 0 -2 0 200 0 vnlock RW ? 0:00.00 (dump) ce24c000
(gdb) pcb 0xce24c000
(gdb) bt
#0 0xcdfb7004 in ?? ()
#1 0xc02362d3 in bpendtsleep () at ../../../../kern/kern_synch.c:508
#2 0xc0226546 in acquire (lkpp=0xce24f7c4, s=0xce24f7ac, extflags=0, drain=0,
wanted=1536) at ../../../../kern/kern_lock.c:264
#3 0xc0226c2e in lockmgr (lkp=0xcfef5130, flags=65538, interlkp=0xcfef50c0)
at ../../../../kern/kern_lock.c:785
#4 0xc0273c6f in genfs_lock (v=0xce24f7f4)
at ../../../../miscfs/genfs/genfs_vnops.c:338
#5 0xc027265f in vn_lock (vp=0xcfef50c0, flags=65538)
at ../../../../sys/vnode_if.h:1273
#6 0xc01e9fb7 in ffs_snapshot (mp=0xc28ec000, vp=0xd33c70bc, ctime=0xce24fb6c)
at ../../../../ufs/ffs/ffs_snapshot.c:381
#7 0xc020e282 in fss_create_files (sc=0xc03b1340, fss=0xce24fea4,
bsize=0xce24fce4, p=0xceeca33c) at ../../../../dev/fss.c:599
#8 0xc020e355 in fss_create_snapshot (sc=0xc03b1340, fss=0xce24fea4,
p=0xceeca33c) at ../../../../dev/fss.c:693
#9 0xc020d6c0 in fss_ioctl (dev=41728, cmd=2148288000,
data=0xce24fea4 "\006\b", flag=0, p=0xceeca33c)
at ../../../../dev/fss.c:294
#10 0xc02784ba in spec_ioctl (v=0xce24fd84)
at ../../../../miscfs/specfs/spec_vnops.c:488
#11 0xc02723bb in vn_ioctl (fp=0xceed64e4, com=2148288000, data=0xce24fea4,
p=0xceeca33c) at ../../../../sys/vnode_if.h:500
#12 0xc02476a2 in sys_ioctl (l=0xcdfb7004, v=0xce24ff64, retval=0xce24ff5c)
at ../../../../kern/sys_generic.c:613
#13 0xc02add87 in syscall_plain (frame=0xce24ffa8)
at ../../../../arch/i386/i386/syscall.c:161
(gdb) p *lkp
$1 = {lk_interlock = {lock_data = 0}, lk_flags = 525312, lk_sharecount = 0,
lk_exclusivecount = 1, lk_recurselevel = 0, lk_waitcount = 2,
lk_wmesg = 0xc0346683 "vnlock", lk_un = {lk_un_sleep = {
lk_sleep_lockholder = 23150, lk_sleep_locklwp = 1, lk_sleep_prio = 20,
lk_sleep_timo = 0, lk_newlock = 0x0}, lk_un_spin = {
lk_spin_cpu = 23150}}}
the locking order has to be fss_lock -> vn_lock, so we need to avoid
sleeping for the fss lock when we're already holding a vnode lock.
the first thread doesn't actually need to take the fss lock since it's
just going to fail immediately anyway, so we just need to skip taking
the fss lock in fss_ioctl() for unknown ioctls.
-Chuck
From: Chuck Silvers <chs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/33060 CVS commit: src/sys/dev
Date: Tue, 14 Mar 2006 15:07:29 +0000 (UTC)
Module Name: src
Committed By: chs
Date: Tue Mar 14 15:07:29 UTC 2006
Modified Files:
src/sys/dev: fss.c fssvar.h
Log Message:
use lockmgr() instead of bespoke code for mutual exclusion in fss_ioctl().
only take the lock when we actually need it (and particularly not for
unknown cmds that are just going to fail immediately). fixes PR 33060.
To generate a diff of this commit:
cvs rdiff -r1.22 -r1.23 src/sys/dev/fss.c
cvs rdiff -r1.12 -r1.13 src/sys/dev/fssvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/33060 CVS commit: [netbsd-3] src/sys/dev
Date: Fri, 17 Mar 2006 15:18:50 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Fri Mar 17 15:18:50 UTC 2006
Modified Files:
src/sys/dev [netbsd-3]: fss.c fssvar.h
Log Message:
Pull up following revision(s) (requested by chs in ticket #1202):
sys/dev/fssvar.h: revision 1.13 via patch
sys/dev/fss.c: revision 1.23 via patch
use lockmgr() instead of bespoke code for mutual exclusion in fss_ioctl().
only take the lock when we actually need it (and particularly not for
unknown cmds that are just going to fail immediately). fixes PR 33060.
To generate a diff of this commit:
cvs rdiff -r1.13.2.2 -r1.13.2.3 src/sys/dev/fss.c
cvs rdiff -r1.8.2.1 -r1.8.2.2 src/sys/dev/fssvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: bouyer@netbsd.org
State-Changed-When: Sat, 06 May 2006 12:20:41 +0000
State-Changed-Why:
fixed by chs@ and pulled up to netbsd-3, I've not seen it since.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.