Subject: kern/7373: adosfs locks against itself when pwd-ing
To: None <gnats-bugs@gnats.netbsd.org>
From: Ignatios Souvatzis <is@jocelyn.rhein.de>
List: netbsd-bugs
Date: 04/13/1999 22:16:34
>Number: 7373
>Category: kern
>Synopsis: adosfs locks against itself when pwd-ing.
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 13 14:05:00 1999
>Last-Modified:
>Originator: Ignatios Souvatzis
>Organization:
Little Daemon Fan Club
>Release: 1999 April 9
>Environment:
System: NetBSD jocelyn 1.4_ALPHA NetBSD 1.4_ALPHA (ISDN7) #14: Tue Apr 13 22:16:18 MEST 1999 is@jocelyn:/build2/i4b/ISDN7 amiga
>Description:
pwd in a mounted adosfs makes the kernel panic("lockmgr: locking
against myself")
stack traceback:
_panic / _adosfs_lock / _vn_lock / _vget / _adosfs_ahashget /
_adosfs_vget / _adosfs_readdir / _getcwd_scandir / _getcwd_common /
_sys__getcwd / _syscall / _trap0
>How-To-Repeat:
mount -t ados -r /dev/sd0h /mnt
cd /mnt/S
tcsh
>Fix:
Bill Sommerfeld suggested this patch:
From sommerfeld@orchard.arlington.ma.us Tue Apr 13 21:57:48 1999
Message-Id: <199904131958.TAA03778@orchard.arlington.ma.us>
To: is@jocelyn.rhein.de
Subject: getcwd patch..
Date: Tue, 13 Apr 1999 15:58:06 -0400
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
Content-Length: 570
Lines: 24
Try this...
Index: vfs_getcwd.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_getcwd.c,v
retrieving revision 1.4
diff -u -r1.4 vfs_getcwd.c
--- vfs_getcwd.c 1999/04/05 03:33:31 1.4
+++ vfs_getcwd.c 1999/04/13 19:57:35
@@ -163,8 +163,14 @@
eofflag = 0;
+ /* XXX un-break adosfs */
+ VOP_UNLOCK(cvp, 0);
+
error = VOP_READDIR(pvp, &uio, p->p_ucred, &eofflag, 0, 0);
+ /* XXX not handling lock failures here.. */
+ (void) vn_lock(cvp, LK_EXCLUSIVE | LK_RETRY);
+
off = uio.uio_offset;
/*
>Audit-Trail:
>Unformatted: