Module Name:    src
Committed By:   riastradh
Date:           Sun Apr 16 16:48:08 UTC 2017

Modified Files:
        src/sys/kern: vfs_vnode.c vnode_if.src

Log Message:
Back out previous.

Breaks file systems for which VOP_UNLOCK doesn't work on a reclaimed
vnode.

The only case in tree right now is sys/fs/union -- most file systems
use genfs_unlock, which does work on a reclaimed vnode.

Maybe we can work around this -- and still enable VOP_RECLAIM's
callees to assert lock ownership -- by having VOP_RECLAIM unlock the
vnode instead.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/vnode_if.src

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.84 src/sys/kern/vfs_vnode.c:1.85
--- src/sys/kern/vfs_vnode.c:1.84	Sat Apr 15 23:16:53 2017
+++ src/sys/kern/vfs_vnode.c	Sun Apr 16 16:48:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.84 2017/04/15 23:16:53 riastradh Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.84 2017/04/15 23:16:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1554,10 +1554,10 @@ vcache_reclaim(vnode_t *vp)
 	 * Note that the VOP_INACTIVE will not unlock the vnode.
 	 */
 	VOP_INACTIVE(vp, &recycle);
+	VOP_UNLOCK(vp);
 	if (VOP_RECLAIM(vp)) {
 		vnpanic(vp, "%s: cannot reclaim", __func__);
 	}
-	VOP_UNLOCK(vp);
 
 	KASSERT(vp->v_data == NULL);
 	KASSERT(vp->v_uobj.uo_npages == 0);

Index: src/sys/kern/vnode_if.src
diff -u src/sys/kern/vnode_if.src:1.72 src/sys/kern/vnode_if.src:1.73
--- src/sys/kern/vnode_if.src:1.72	Sat Apr 15 23:16:53 2017
+++ src/sys/kern/vnode_if.src	Sun Apr 16 16:48:08 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: vnode_if.src,v 1.72 2017/04/15 23:16:53 riastradh Exp $
+#	$NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -393,11 +393,11 @@ vop_inactive {
 };
 
 #
-#% reclaim    vp      L L L
+#% reclaim    vp      U U U
 #
 vop_reclaim {
 	FSTRANS=NO
-	IN LOCKED=YES struct vnode *vp;
+	IN LOCKED=NO struct vnode *vp;
 };
 
 #

Reply via email to