Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/kern Pull up following revision(s) (requested by hann...



details:   https://anonhg.NetBSD.org/src/rev/952d392baae2
branches:  netbsd-6
changeset: 774005:952d392baae2
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Apr 12 17:15:23 2012 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #179):
        sys/kern/vfs_vnops.c: revision 1.184
Fix vn_lock() to return an invalid (dead, clean) vnode
only if the caller requested it by setting LK_RETRY.
Should fix PR #46221: Kernel panic in NFS server code

diffstat:

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

diffs (34 lines):

diff -r 7855032288c9 -r 952d392baae2 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Thu Apr 12 17:12:06 2012 +0000
+++ b/sys/kern/vfs_vnops.c      Thu Apr 12 17:15:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $  */
+/*     $NetBSD: vfs_vnops.c,v 1.183.8.1 2012/04/12 17:15:23 riz Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.183.8.1 2012/04/12 17:15:23 riz Exp $");
 
 #include "veriexec.h"
 
@@ -805,6 +805,15 @@
                } else {
                        mutex_exit(vp->v_interlock);
                        error = VOP_LOCK(vp, (flags & ~LK_RETRY));
+                       if (error == 0 && (flags & LK_RETRY) == 0) {
+                               mutex_enter(vp->v_interlock);
+                               if ((vp->v_iflag & VI_CLEAN)) {
+                                       mutex_exit(vp->v_interlock);
+                                       VOP_UNLOCK(vp);
+                                       return ENOENT;
+                               }
+                               mutex_exit(vp->v_interlock);
+                       }
                        if (error == 0 || error == EDEADLK || error == EBUSY)
                                return (error);
                }



Home | Main Index | Thread Index | Old Index