Submitted by: Mike Pritchard <pritc003@maroon.tc.umn.edu>

Fix PR 303: msdosfs: moving a file into another directory causes panic.

" ... the code that does the rename already has the denode
locked when msdosfs_hashins() gets called, resulting in the panic
when the routine attempts to lock the denode again.
...
The attached patch changes the msdosfs_hashins() routine to not lock the
denode.  The caller is now resposible for obtaining the lock instead
of having msdosfs_hashins() do it for them."
This commit is contained in:
Bruce Evans 1995-04-11 17:13:17 +00:00
parent 82f196916e
commit 2360b9bfc7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7755
2 changed files with 4 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_denode.c,v 1.9 1995/03/16 18:14:18 bde Exp $ */
/* $Id: msdosfs_denode.c,v 1.10 1995/03/19 12:11:13 davidg Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */
/*-
@ -119,13 +119,6 @@ msdosfs_hashins(dep)
dep->de_next = deq;
dep->de_prev = depp;
*depp = dep;
if (dep->de_flag & DE_LOCKED)
panic("msdosfs_hashins: already locked");
if (curproc)
dep->de_lockholder = curproc->p_pid;
else
dep->de_lockholder = -1;
dep->de_flag |= DE_LOCKED;
}
static void
@ -235,6 +228,7 @@ deget(pmp, dirclust, diroffset, direntptr, depp)
* can't be accessed until we've read it in and have done what we
* need to it.
*/
VOP_LOCK(nvp);
msdosfs_hashins(ldep);
/*

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_denode.c,v 1.9 1995/03/16 18:14:18 bde Exp $ */
/* $Id: msdosfs_denode.c,v 1.10 1995/03/19 12:11:13 davidg Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */
/*-
@ -119,13 +119,6 @@ msdosfs_hashins(dep)
dep->de_next = deq;
dep->de_prev = depp;
*depp = dep;
if (dep->de_flag & DE_LOCKED)
panic("msdosfs_hashins: already locked");
if (curproc)
dep->de_lockholder = curproc->p_pid;
else
dep->de_lockholder = -1;
dep->de_flag |= DE_LOCKED;
}
static void
@ -235,6 +228,7 @@ deget(pmp, dirclust, diroffset, direntptr, depp)
* can't be accessed until we've read it in and have done what we
* need to it.
*/
VOP_LOCK(nvp);
msdosfs_hashins(ldep);
/*