Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix bogus fast path in vput.



details:   https://anonhg.NetBSD.org/src/rev/0799f0fc432b
branches:  trunk
changeset: 936791:0799f0fc432b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Aug 04 03:00:10 2020 +0000

description:
Fix bogus fast path in vput.

If we can't discern whether we have an exclusive or shared lock, then
just unlock and don't play fast and loose with pretending that we
have an exclusive lock will work -- it won't.

diffstat:

 sys/kern/vfs_vnode.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 3b797cf2f8e9 -r 0799f0fc432b sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c      Tue Aug 04 02:09:57 2020 +0000
+++ b/sys/kern/vfs_vnode.c      Tue Aug 04 03:00:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnode.c,v 1.125 2020/06/14 00:20:17 ad Exp $       */
+/*     $NetBSD: vfs_vnode.c,v 1.126 2020/08/04 03:00:10 riastradh Exp $        */
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.125 2020/06/14 00:20:17 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.126 2020/08/04 03:00:10 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -756,7 +756,8 @@
                }
                lktype = LK_NONE;
        } else if ((vp->v_vflag & VV_LOCKSWORK) == 0) {
-               lktype = LK_EXCLUSIVE;
+               VOP_UNLOCK(vp);
+               lktype = LK_NONE;
        } else {
                lktype = VOP_ISLOCKED(vp);
                KASSERT(lktype != LK_NONE);



Home | Main Index | Thread Index | Old Index