Make sure we actually locked the parent vnode before we clear
PDIRUNLOCK. The whole reason we have the flag is to note (rare) cases where we are supposed to have the parent directory locked but don't. Permits error handling code to know what to do with the parrent vnode (vrele() vs vput()).
This commit is contained in:
parent
26759c3afa
commit
9cbb082fac
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: layer_vnops.c,v 1.20 2004/06/16 12:39:07 yamt Exp $ */
|
||||
/* $NetBSD: layer_vnops.c,v 1.21 2004/06/16 17:59:53 wrstuden Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 National Aeronautics & Space Administration
|
||||
|
@ -67,7 +67,7 @@
|
|||
*
|
||||
* Ancestors:
|
||||
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
|
||||
* $Id: layer_vnops.c,v 1.20 2004/06/16 12:39:07 yamt Exp $
|
||||
* $Id: layer_vnops.c,v 1.21 2004/06/16 17:59:53 wrstuden Exp $
|
||||
* ...and...
|
||||
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
|
||||
*/
|
||||
|
@ -232,7 +232,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.20 2004/06/16 12:39:07 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.21 2004/06/16 17:59:53 wrstuden Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -473,8 +473,8 @@ layer_lookup(v)
|
|||
if (error) {
|
||||
vput(vp);
|
||||
if (cnp->cn_flags & PDIRUNLOCK) {
|
||||
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
if (vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY) == 0)
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: umap_vnops.c,v 1.30 2004/06/16 12:39:07 yamt Exp $ */
|
||||
/* $NetBSD: umap_vnops.c,v 1.31 2004/06/16 17:59:53 wrstuden Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: umap_vnops.c,v 1.30 2004/06/16 12:39:07 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: umap_vnops.c,v 1.31 2004/06/16 17:59:53 wrstuden Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -406,8 +406,8 @@ umap_lookup(v)
|
|||
if (error) {
|
||||
vput(vp);
|
||||
if (cnp->cn_flags & PDIRUNLOCK) {
|
||||
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
if (vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY) == 0)
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue