Subject: kern/18976: lfs_rmdir: wrong lock
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 11/09/2002 01:45:57
>Number: 18976
>Category: kern
>Synopsis: lfs_rmdir: wrong lock
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 08 08:55:07 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 1.6K
>Organization:
>Environment:
System: NetBSD kaeru 1.6K NetBSD 1.6K (build.kaeru) #170: Sat Nov 9 00:41:22 JST 2002 takashi@kaeru:/usr/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
lfs_rmdir doesn't unlock vnode correctly in error case.
it causes "lock against myself" panic.
>How-To-Repeat:
>Fix:
Index: lfs_vnops.c
===================================================================
RCS file: /cvs/NetBSD/syssrc/sys/ufs/lfs/lfs_vnops.c,v
retrieving revision 1.68
diff -u -p -r1.68 lfs_vnops.c
--- lfs_vnops.c 2002/10/23 09:15:07 1.68
+++ lfs_vnops.c 2002/11/08 16:42:22
@@ -675,7 +678,7 @@ lfs_rmdir(void *v)
if ((error = SET_DIROP(ap->a_dvp)) != 0) {
vrele(ap->a_dvp);
- if (ap->a_vp->v_mountedhere != NULL)
+ if (ap->a_vp != ap->a_dvp)
VOP_UNLOCK(ap->a_dvp, 0);
vput(ap->a_vp);
return error;
>Release-Note:
>Audit-Trail:
>Unformatted: