Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs fix panic introduced by my previous commit.



details:   https://anonhg.NetBSD.org/src/rev/254cd15e034e
branches:  trunk
changeset: 538534:254cd15e034e
user:      yamt <yamt%NetBSD.org@localhost>
date:      Tue Oct 22 10:10:28 2002 +0000

description:
fix panic introduced by my previous commit.

for device special files, VOP_UNLOCK is called
by nfs_loadattrcache with v_data == 0.

reported and tested by Matthias Drochner.

diffstat:

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

diffs (33 lines):

diff -r 8577b3f7412d -r 254cd15e034e sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Tue Oct 22 09:30:26 2002 +0000
+++ b/sys/nfs/nfs_vnops.c       Tue Oct 22 10:10:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.154 2002/10/22 02:19:57 simonb Exp $   */
+/*     $NetBSD: nfs_vnops.c,v 1.155 2002/10/22 10:10:28 yamt Exp $     */
 
 /*
  * Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.154 2002/10/22 02:19:57 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.155 2002/10/22 10:10:28 yamt Exp $");
 
 #include "opt_nfs.h"
 #include "opt_uvmhist.h"
@@ -3105,7 +3105,13 @@
        } */ *ap = v;
        struct vnode *vp = ap->a_vp;
 
-       nfs_delayedtruncate(vp);
+       /*
+        * VOP_UNLOCK can be called by nfs_loadattrcache
+        * with v_data == 0.
+        */
+       if (VTONFS(vp)) {
+               nfs_delayedtruncate(vp);
+       }
 
        return genfs_unlock(v);
 }



Home | Main Index | Thread Index | Old Index