Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Previous change to vn_lock() was bogus. If we got ...



details:   https://anonhg.NetBSD.org/src/rev/1f7a21eb4c67
branches:  trunk
changeset: 467957:1f7a21eb4c67
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Mar 31 18:30:13 1999 +0000

description:
Previous change to vn_lock() was bogus.  If we got EDEADLK, it was from
lockmgr(), and it already unlocked v_interlock.  So, just return in this case.

diffstat:

 sys/kern/vfs_vnops.c |  14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diffs (40 lines):

diff -r f19d299cfe45 -r 1f7a21eb4c67 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Wed Mar 31 18:14:27 1999 +0000
+++ b/sys/kern/vfs_vnops.c      Wed Mar 31 18:30:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.35 1999/03/30 00:16:44 wrstuden Exp $  */
+/*     $NetBSD: vfs_vnops.c,v 1.36 1999/03/31 18:30:13 mycroft Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -537,13 +537,10 @@
        int flags;
 {
        int error;
-       int have_interlock = 0;
 
        do {
-               if ((flags & LK_INTERLOCK) == 0) {
+               if ((flags & LK_INTERLOCK) == 0)
                        simple_lock(&vp->v_interlock);
-                       have_interlock++;
-               }
                if (vp->v_flag & VXLOCK) {
                        vp->v_flag |= VXWANT;
                        simple_unlock(&vp->v_interlock);
@@ -551,14 +548,9 @@
                        error = ENOENT;
                } else {
                        error = VOP_LOCK(vp, flags | LK_INTERLOCK);
-                       if (error == 0)
+                       if (error == 0 || error == EDEADLK)
                                return (error);
                }
-               if (error == EDEADLK) {
-                       if (have_interlock)
-                               simple_unlock(&vp->v_interlock);
-                       break;
-               }
                flags &= ~LK_INTERLOCK;
        } while (flags & LK_RETRY);
        return (error);



Home | Main Index | Thread Index | Old Index