Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/nfs Apply patch (requested by fvdl):



details:   https://anonhg.NetBSD.org/src/rev/fda00d263f67
branches:  netbsd-1-4
changeset: 470864:fda00d263f67
user:      he <he%NetBSD.org@localhost>
date:      Tue Aug 15 22:36:40 2000 +0000

description:
Apply patch (requested by fvdl):
  Be careful about data consistency across operations which may
  block.  Should fix some reported nfs_lookup panics.

diffstat:

 sys/nfs/nfs_vnops.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 5b33883bf6b1 -r fda00d263f67 sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Tue Aug 15 22:18:10 2000 +0000
+++ b/sys/nfs/nfs_vnops.c       Tue Aug 15 22:36:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.100.2.2 2000/01/05 23:39:50 he Exp $   */
+/*     $NetBSD: nfs_vnops.c,v 1.100.2.3 2000/08/15 22:36:40 he Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -780,6 +780,12 @@
                struct vattr vattr;
                int vpid, err2;
 
+               if (error != ENOENT) {
+                       /* needs to happen before anything which can block.. */
+                       newvp = *vpp;
+                       vpid = newvp->v_id;
+               }
+                       
                err2 = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, cnp->cn_proc);
                if (err2) {
                        *vpp = NULLVP;
@@ -796,8 +802,6 @@
                        goto dorpc;
                }
 
-               newvp = *vpp;
-               vpid = newvp->v_id;
                /*
                 * See the comment starting `Step through' in ufs/ufs_lookup.c
                 * for an explanation of the locking protocol
@@ -819,6 +823,8 @@
                           }
                           cache_purge(newvp);
                        }
+                       if (dvp != newvp)
+                               VOP_UNLOCK(newvp, 0);
                        vrele(newvp);
                }
                *vpp = NULLVP;



Home | Main Index | Thread Index | Old Index