summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1997-04-04 17:49:35 +0000
committerdfr <dfr@FreeBSD.org>1997-04-04 17:49:35 +0000
commit290a0d9360310ac92d01cfc64a53d6bf7ab7bdd1 (patch)
treeb639f0a11f6ef68503e426899f8cd98dbaeeae79 /sys
parent5974d18a75cb3c6a9b4abc4a5f45fcfe3e47f1fe (diff)
downloadFreeBSD-src-290a0d9360310ac92d01cfc64a53d6bf7ab7bdd1.zip
FreeBSD-src-290a0d9360310ac92d01cfc64a53d6bf7ab7bdd1.tar.gz
Fix various bugs in the locking protocol, allowing proper shared locks
to be used. This should fix the lock panics that people are seeing.
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_common.c10
-rw-r--r--sys/nfs/nfs_subs.c10
-rw-r--r--sys/nfs/nfs_vfsops.c3
-rw-r--r--sys/nfs/nfs_vnops.c4
-rw-r--r--sys/nfs/nfsnode.h4
-rw-r--r--sys/nfsclient/nfs_subs.c10
-rw-r--r--sys/nfsclient/nfs_vfsops.c3
-rw-r--r--sys/nfsclient/nfs_vnops.c4
-rw-r--r--sys/nfsclient/nfsnode.h4
-rw-r--r--sys/nfsserver/nfs_srvsubs.c10
10 files changed, 14 insertions, 48 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 15497ff..572ccc2 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id$
+ * $Id: nfs_subs.c,v 1.37 1997/02/22 09:42:41 peter Exp $
*/
/*
@@ -1280,14 +1280,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
np = VTONFS(vp);
if (vp->v_type != vtyp) {
- /*
- * If we had a lock and it turns out that the vnode
- * is an object which we don't want to lock (e.g. VDIR)
- * to avoid nasty hanging problems on a server crash,
- * then release it here.
- */
- if (vtyp != VREG && VOP_ISLOCKED(vp))
- VOP_UNLOCK(vp, 0, p);
vp->v_type = vtyp;
if (vp->v_type == VFIFO) {
vp->v_op = fifo_nfsv2nodeop_p;
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 15497ff..572ccc2 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id$
+ * $Id: nfs_subs.c,v 1.37 1997/02/22 09:42:41 peter Exp $
*/
/*
@@ -1280,14 +1280,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
np = VTONFS(vp);
if (vp->v_type != vtyp) {
- /*
- * If we had a lock and it turns out that the vnode
- * is an object which we don't want to lock (e.g. VDIR)
- * to avoid nasty hanging problems on a server crash,
- * then release it here.
- */
- if (vtyp != VREG && VOP_ISLOCKED(vp))
- VOP_UNLOCK(vp, 0, p);
vp->v_type = vtyp;
if (vp->v_type == VFIFO) {
vp->v_op = fifo_nfsv2nodeop_p;
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index fcc6a4c..84963cf 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.35 1997/02/22 09:42:44 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.36 1997/03/24 11:33:39 bde Exp $
*/
#include <sys/param.h>
@@ -904,7 +904,6 @@ nfs_root(mp, vpp)
if (error)
return (error);
vp = NFSTOV(np);
- VOP_UNLOCK(vp, 0, curproc);
if (vp->v_type == VNON)
vp->v_type = VDIR;
vp->v_flag = VROOT;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 060a578..0d90627 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.44 1997/03/22 06:53:12 bde Exp $
+ * $Id: nfs_vnops.c,v 1.45 1997/03/29 12:40:20 bde Exp $
*/
@@ -1603,7 +1603,7 @@ nfs_rename(ap)
*/
if (tvp && tvp->v_usecount > 1 && !VTONFS(tvp)->n_sillyrename &&
tvp->v_type != VDIR && !nfs_sillyrename(tdvp, tvp, tcnp)) {
- vrele(tvp);
+ vput(tvp);
tvp = NULL;
}
diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h
index d2038a0..540d803 100644
--- a/sys/nfs/nfsnode.h
+++ b/sys/nfs/nfsnode.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsnode.h 8.9 (Berkeley) 5/14/95
- * $Id$
+ * $Id: nfsnode.h,v 1.19 1997/02/22 09:42:49 peter Exp $
*/
@@ -169,7 +169,7 @@ int nqnfs_vop_lease_check __P((struct vop_lease_args *));
int nfs_abortop __P((struct vop_abortop_args *));
int nfs_inactive __P((struct vop_inactive_args *));
int nfs_reclaim __P((struct vop_reclaim_args *));
-#define nfs_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock)
+#define nfs_lock ((int (*) __P((struct vop_lock_args *)))vop_sharedlock)
#define nfs_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock)
#define nfs_islocked ((int (*) __P((struct vop_islocked_args *)))vop_noislocked)
#define nfs_reallocblks \
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 15497ff..572ccc2 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id$
+ * $Id: nfs_subs.c,v 1.37 1997/02/22 09:42:41 peter Exp $
*/
/*
@@ -1280,14 +1280,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
np = VTONFS(vp);
if (vp->v_type != vtyp) {
- /*
- * If we had a lock and it turns out that the vnode
- * is an object which we don't want to lock (e.g. VDIR)
- * to avoid nasty hanging problems on a server crash,
- * then release it here.
- */
- if (vtyp != VREG && VOP_ISLOCKED(vp))
- VOP_UNLOCK(vp, 0, p);
vp->v_type = vtyp;
if (vp->v_type == VFIFO) {
vp->v_op = fifo_nfsv2nodeop_p;
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index fcc6a4c..84963cf 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.35 1997/02/22 09:42:44 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.36 1997/03/24 11:33:39 bde Exp $
*/
#include <sys/param.h>
@@ -904,7 +904,6 @@ nfs_root(mp, vpp)
if (error)
return (error);
vp = NFSTOV(np);
- VOP_UNLOCK(vp, 0, curproc);
if (vp->v_type == VNON)
vp->v_type = VDIR;
vp->v_flag = VROOT;
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 060a578..0d90627 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.44 1997/03/22 06:53:12 bde Exp $
+ * $Id: nfs_vnops.c,v 1.45 1997/03/29 12:40:20 bde Exp $
*/
@@ -1603,7 +1603,7 @@ nfs_rename(ap)
*/
if (tvp && tvp->v_usecount > 1 && !VTONFS(tvp)->n_sillyrename &&
tvp->v_type != VDIR && !nfs_sillyrename(tdvp, tvp, tcnp)) {
- vrele(tvp);
+ vput(tvp);
tvp = NULL;
}
diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h
index d2038a0..540d803 100644
--- a/sys/nfsclient/nfsnode.h
+++ b/sys/nfsclient/nfsnode.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsnode.h 8.9 (Berkeley) 5/14/95
- * $Id$
+ * $Id: nfsnode.h,v 1.19 1997/02/22 09:42:49 peter Exp $
*/
@@ -169,7 +169,7 @@ int nqnfs_vop_lease_check __P((struct vop_lease_args *));
int nfs_abortop __P((struct vop_abortop_args *));
int nfs_inactive __P((struct vop_inactive_args *));
int nfs_reclaim __P((struct vop_reclaim_args *));
-#define nfs_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock)
+#define nfs_lock ((int (*) __P((struct vop_lock_args *)))vop_sharedlock)
#define nfs_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock)
#define nfs_islocked ((int (*) __P((struct vop_islocked_args *)))vop_noislocked)
#define nfs_reallocblks \
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 15497ff..572ccc2 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id$
+ * $Id: nfs_subs.c,v 1.37 1997/02/22 09:42:41 peter Exp $
*/
/*
@@ -1280,14 +1280,6 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
np = VTONFS(vp);
if (vp->v_type != vtyp) {
- /*
- * If we had a lock and it turns out that the vnode
- * is an object which we don't want to lock (e.g. VDIR)
- * to avoid nasty hanging problems on a server crash,
- * then release it here.
- */
- if (vtyp != VREG && VOP_ISLOCKED(vp))
- VOP_UNLOCK(vp, 0, p);
vp->v_type = vtyp;
if (vp->v_type == VFIFO) {
vp->v_op = fifo_nfsv2nodeop_p;
OpenPOWER on IntegriCloud