mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 12:44:53 +01:00
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:
parent
7f98df5944
commit
49bffa9247
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user