Don't lock an already locked vnode.

This commit is contained in:
pooka 2014-04-25 15:18:06 +00:00
parent 7028473ae3
commit 45fe388485
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: smbfs_vnops.c,v 1.89 2014/02/07 15:29:21 hannken Exp $ */
/* $NetBSD: smbfs_vnops.c,v 1.90 2014/04/25 15:18:06 pooka Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.89 2014/02/07 15:29:21 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.90 2014/04/25 15:18:06 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1244,9 +1244,11 @@ smbfs_lookup(void *v)
}
newvp = *vpp;
vn_lock(newvp, LK_SHARED | LK_RETRY);
if (newvp != dvp)
vn_lock(newvp, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(newvp, &vattr, cnp->cn_cred);
VOP_UNLOCK(newvp);
if (newvp != dvp)
VOP_UNLOCK(newvp);
/*
* If the file type on the server is inconsistent
* with what it was when we created the vnode,