Subject: locking botch in umount
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 03/26/2002 12:53:46
I've been working with a proprietary PowerPC port based on 1.5W.  At
one point, at shutdown, I got this (the kernel has LOCKDEBUG, as we've
seen problems that appear to be locking-related):

pool_get(PR_WAITOK) with held simple_lock 0x144040 CPU 0 ../../../../kern/vfs_syscalls.c:526 [67565719]
at end+5be974b8
trap: kernel read DSI @ 0xc00b7107 by 0xecbf8 (DSISR 0x40000000)
Stopped in pid 52 (crunch) at   db_stack_trace_print+0x9c:      lwz r11, r28, 0x
4,
db> 

A traceback shows

db> tr
at simple_lock_only_held+e0
at pool_get+a4
at getnewvnode+14c
at vfs_allocate_syncvnode+28
at dounmount+198
at mfs_start+130
at .Ltext10+50
at trap+410
saved LR(0x57ac) is invalid.
db>

which looks like a real bug to me: dounmount locks the mount table
(line 491 of vfs_syscalls.c 1.165) and then makes calls as the
traceback indicates, ending up, as the message says, doing a pool_get
with PR_WAITOK, still holding that simple-lock.

Am I Missing Something (tm)?  Worth a PR?

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B