Module Name:    src
Committed By:   riastradh
Date:           Sat Apr  1 19:35:57 UTC 2017

Modified Files:
        src/sys/fs/msdosfs: msdosfs_vfsops.c
        src/sys/fs/puffs: puffs_vfsops.c
        src/sys/fs/smbfs: smbfs_vfsops.c
        src/sys/fs/udf: udf_subr.c udf_vfsops.c
        src/sys/fs/union: union_vfsops.c
        src/sys/fs/v7fs: v7fs_vfsops.c
        src/sys/miscfs/procfs: procfs_subr.c
        src/sys/nfs: nfs_subs.c nfs_vfsops.c
        src/sys/rump/librump/rumpvfs: rump_vfs.c
        src/sys/ufs/chfs: chfs_vnode.c
        src/sys/ufs/ext2fs: ext2fs_vfsops.c
        src/sys/ufs/ffs: ffs_snapshot.c ffs_vfsops.c
        src/sys/ufs/lfs: lfs_segment.c

Log Message:
KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.119 -r1.120 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.105 -r1.106 src/sys/fs/smbfs/smbfs_vfsops.c
cvs rdiff -u -r1.138 -r1.139 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.12 -r1.13 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.107 -r1.108 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.228 -r1.229 src/sys/nfs/nfs_subs.c
cvs rdiff -u -r1.232 -r1.233 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.86 -r1.87 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/chfs/chfs_vnode.c
cvs rdiff -u -r1.205 -r1.206 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.147 -r1.148 src/sys/ufs/ffs/ffs_snapshot.c
cvs rdiff -u -r1.350 -r1.351 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.264 -r1.265 src/sys/ufs/lfs/lfs_segment.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.124 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.125
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.124	Wed Mar  1 10:41:28 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 hannken Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -971,6 +971,8 @@ msdosfs_sync_selector(void *cl, struct v
 	struct msdosfs_sync_ctx *c = cl;
 	struct denode *dep;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	dep = VTODE(vp);
 	if (c->waitfor == MNT_LAZY || vp->v_type == VNON ||
 	    dep == NULL || (((dep->de_flag &

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.119 src/sys/fs/puffs/puffs_vfsops.c:1.120
--- src/sys/fs/puffs/puffs_vfsops.c:1.119	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/puffs/puffs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.119 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.120 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.119 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.120 2017/04/01 19:35:56 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -511,6 +511,9 @@ puffs_vfsop_statvfs(struct mount *mp, st
 static bool
 pageflush_selector(void *cl, struct vnode *vp)
 {
+
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	return vp->v_type == VREG &&
 	    !(LIST_EMPTY(&vp->v_dirtyblkhd) && UVM_OBJ_IS_CLEAN(&vp->v_uobj));
 }

Index: src/sys/fs/smbfs/smbfs_vfsops.c
diff -u src/sys/fs/smbfs/smbfs_vfsops.c:1.105 src/sys/fs/smbfs/smbfs_vfsops.c:1.106
--- src/sys/fs/smbfs/smbfs_vfsops.c:1.105	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/smbfs/smbfs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: smbfs_vfsops.c,v 1.106 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.106 2017/04/01 19:35:56 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -398,6 +398,8 @@ smbfs_sync_selector(void *cl, struct vno
 {
 	struct smbnode *np;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	np = VTOSMB(vp);
 	if (np == NULL)
 		return false;

Index: src/sys/fs/udf/udf_subr.c
diff -u src/sys/fs/udf/udf_subr.c:1.138 src/sys/fs/udf/udf_subr.c:1.139
--- src/sys/fs/udf/udf_subr.c:1.138	Tue May 24 09:55:57 2016
+++ src/sys/fs/udf/udf_subr.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.138 2016/05/24 09:55:57 reinoud Exp $ */
+/* $NetBSD: udf_subr.c,v 1.139 2017/04/01 19:35:56 riastradh Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.138 2016/05/24 09:55:57 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.139 2017/04/01 19:35:56 riastradh Exp $");
 #endif /* not lint */
 
 
@@ -6393,7 +6393,11 @@ udf_sync_pass(struct udf_mount *ump, kau
 static bool
 udf_sync_selector(void *cl, struct vnode *vp)
 {
-	struct udf_node *udf_node = VTOI(vp);
+	struct udf_node *udf_node;
+
+	KASSERT(mutex_owned(vp->v_interlock));
+
+	udf_node = VTOI(vp);
 
 	if (vp->v_vflag & VV_SYSTEM)
 		return false;

Index: src/sys/fs/udf/udf_vfsops.c
diff -u src/sys/fs/udf/udf_vfsops.c:1.74 src/sys/fs/udf/udf_vfsops.c:1.75
--- src/sys/fs/udf/udf_vfsops.c:1.74	Fri Feb 17 08:31:25 2017
+++ src/sys/fs/udf/udf_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vfsops.c,v 1.74 2017/02/17 08:31:25 hannken Exp $ */
+/* $NetBSD: udf_vfsops.c,v 1.75 2017/04/01 19:35:56 riastradh Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.74 2017/02/17 08:31:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.75 2017/04/01 19:35:56 riastradh Exp $");
 #endif /* not lint */
 
 
@@ -442,6 +442,8 @@ static bool
 udf_sanity_selector(void *cl, struct vnode *vp)
 {
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	vprint("", vp);
 	if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) {
 		printf("  is locked\n");

Index: src/sys/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.77 src/sys/fs/union/union_vfsops.c:1.78
--- src/sys/fs/union/union_vfsops.c:1.77	Mon Mar  6 10:10:07 2017
+++ src/sys/fs/union/union_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.77 2017/03/06 10:10:07 hannken Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.78 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.77 2017/03/06 10:10:07 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.78 2017/04/01 19:35:56 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -322,6 +322,8 @@ union_unmount_selector(void *cl, struct 
 {
 	int *count = cl;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	*count += 1;
 	return false;
 }

Index: src/sys/fs/v7fs/v7fs_vfsops.c
diff -u src/sys/fs/v7fs/v7fs_vfsops.c:1.12 src/sys/fs/v7fs/v7fs_vfsops.c:1.13
--- src/sys/fs/v7fs/v7fs_vfsops.c:1.12	Mon Dec 29 15:29:38 2014
+++ src/sys/fs/v7fs/v7fs_vfsops.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs_vfsops.c,v 1.12 2014/12/29 15:29:38 hannken Exp $	*/
+/*	$NetBSD: v7fs_vfsops.c,v 1.13 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.12 2014/12/29 15:29:38 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.13 2017/04/01 19:35:57 riastradh Exp $");
 #if defined _KERNEL_OPT
 #include "opt_v7fs.h"
 #endif
@@ -369,8 +369,11 @@ v7fs_statvfs(struct mount *mp, struct st
 static bool
 v7fs_sync_selector(void *cl, struct vnode *vp)
 {
-	struct v7fs_node *v7fs_node = vp->v_data;
+	struct v7fs_node *v7fs_node;
+
+	KASSERT(mutex_owned(vp->v_interlock));
 
+	v7fs_node = vp->v_data;
 	if (v7fs_node == NULL)
 		return false;
 	if (!v7fs_inode_allocated(&v7fs_node->inode))

Index: src/sys/miscfs/procfs/procfs_subr.c
diff -u src/sys/miscfs/procfs/procfs_subr.c:1.107 src/sys/miscfs/procfs/procfs_subr.c:1.108
--- src/sys/miscfs/procfs/procfs_subr.c:1.107	Thu Mar 30 20:16:29 2017
+++ src/sys/miscfs/procfs/procfs_subr.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_subr.c,v 1.107 2017/03/30 20:16:29 christos Exp $	*/
+/*	$NetBSD: procfs_subr.c,v 1.108 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.107 2017/03/30 20:16:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.108 2017/04/01 19:35:57 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -355,7 +355,11 @@ static bool
 procfs_revoke_selector(void *arg, struct vnode *vp)
 {
 	struct proc *p = arg;
-	struct pfsnode *pfs = VTOPFS(vp);
+	struct pfsnode *pfs;
+
+	KASSERT(mutex_owned(vp->v_interlock));
+
+	pfs = VTOPFS(vp);
 
 	return (pfs != NULL && pfs->pfs_pid == p->p_pid);
 }

Index: src/sys/nfs/nfs_subs.c
diff -u src/sys/nfs/nfs_subs.c:1.228 src/sys/nfs/nfs_subs.c:1.229
--- src/sys/nfs/nfs_subs.c:1.228	Fri Jun 10 13:27:16 2016
+++ src/sys/nfs/nfs_subs.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subs.c,v 1.228 2016/06/10 13:27:16 ozaki-r Exp $	*/
+/*	$NetBSD: nfs_subs.c,v 1.229 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.228 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.229 2017/04/01 19:35:57 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -1753,6 +1753,8 @@ nfs_clearcommit_selector(void *cl, struc
 	struct nfsnode *np;
 	struct vm_page *pg;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	np = VTONFS(vp);
 	if (vp->v_type != VREG || vp->v_mount != c->mp || np == NULL)
 		return false;

Index: src/sys/nfs/nfs_vfsops.c
diff -u src/sys/nfs/nfs_vfsops.c:1.232 src/sys/nfs/nfs_vfsops.c:1.233
--- src/sys/nfs/nfs_vfsops.c:1.232	Fri Feb 17 08:31:25 2017
+++ src/sys/nfs/nfs_vfsops.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vfsops.c,v 1.232 2017/02/17 08:31:25 hannken Exp $	*/
+/*	$NetBSD: nfs_vfsops.c,v 1.233 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.232 2017/02/17 08:31:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.233 2017/04/01 19:35:57 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_nfs.h"
@@ -960,6 +960,8 @@ static bool
 nfs_sync_selector(void *cl, struct vnode *vp)
 {
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	return !LIST_EMPTY(&vp->v_dirtyblkhd) || !UVM_OBJ_IS_CLEAN(&vp->v_uobj);
 }
 

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.86 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.87
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.86	Thu Nov 17 23:15:38 2016
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.86 2016/11/17 23:15:38 pgoyette Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.87 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.86 2016/11/17 23:15:38 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.87 2017/04/01 19:35:57 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -476,6 +476,8 @@ rump_print_selector(void *cl, struct vno
 {
 	int *full = cl;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	vfs_vnode_print(vp, *full, (void *)rumpuser_dprintf);
 	return false;
 }

Index: src/sys/ufs/chfs/chfs_vnode.c
diff -u src/sys/ufs/chfs/chfs_vnode.c:1.14 src/sys/ufs/chfs/chfs_vnode.c:1.15
--- src/sys/ufs/chfs/chfs_vnode.c:1.14	Sun Jan 11 17:29:57 2015
+++ src/sys/ufs/chfs/chfs_vnode.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_vnode.c,v 1.14 2015/01/11 17:29:57 hannken Exp $	*/
+/*	$NetBSD: chfs_vnode.c,v 1.15 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -47,6 +47,8 @@ chfs_vnode_lookup_selector(void *ctx, st
 {
 	ino_t *ino = ctx;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	return (VTOI(vp) != NULL && VTOI(vp)->ino == *ino);
 }
 struct vnode *

Index: src/sys/ufs/ext2fs/ext2fs_vfsops.c
diff -u src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.205 src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.206
--- src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.205	Fri Feb 17 08:31:26 2017
+++ src/sys/ufs/ext2fs/ext2fs_vfsops.c	Sat Apr  1 19:35:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_vfsops.c,v 1.205 2017/02/17 08:31:26 hannken Exp $	*/
+/*	$NetBSD: ext2fs_vfsops.c,v 1.206 2017/04/01 19:35:57 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.205 2017/02/17 08:31:26 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.206 2017/04/01 19:35:57 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -882,6 +882,8 @@ ext2fs_sync_selector(void *cl, struct vn
 {
 	struct inode *ip;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	ip = VTOI(vp);
 	/*
 	 * Skip the vnode/inode if inaccessible.

Index: src/sys/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.147 src/sys/ufs/ffs/ffs_snapshot.c:1.148
--- src/sys/ufs/ffs/ffs_snapshot.c:1.147	Sat Mar 18 05:29:16 2017
+++ src/sys/ufs/ffs/ffs_snapshot.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.147 2017/03/18 05:29:16 riastradh Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.148 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.147 2017/03/18 05:29:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.148 2017/04/01 19:35:56 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -630,6 +630,8 @@ snapshot_expunge_selector(void *cl, stru
 	struct snapshot_expunge_ctx *c = cl;
 	struct inode *xp;
 
+	KASSERT(mutex_owned(xvp->v_interlock));
+
 	xp = VTOI(xvp);
 	if (xvp->v_type == VNON || VTOI(xvp) == NULL ||
 	    (xp->i_flags & SF_SNAPSHOT))

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.350 src/sys/ufs/ffs/ffs_vfsops.c:1.351
--- src/sys/ufs/ffs/ffs_vfsops.c:1.350	Fri Mar 10 20:38:28 2017
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.350 2017/03/10 20:38:28 jdolecek Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.351 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.350 2017/03/10 20:38:28 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.351 2017/04/01 19:35:56 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1843,6 +1843,8 @@ ffs_sync_selector(void *cl, struct vnode
 	struct ffs_sync_ctx *c = cl;
 	struct inode *ip;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
 	ip = VTOI(vp);
 	/*
 	 * Skip the vnode/inode if inaccessible.

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.264 src/sys/ufs/lfs/lfs_segment.c:1.265
--- src/sys/ufs/lfs/lfs_segment.c:1.264	Mon Mar 13 14:24:20 2017
+++ src/sys/ufs/lfs/lfs_segment.c	Sat Apr  1 19:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.264 2017/03/13 14:24:20 riastradh Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.265 2017/04/01 19:35:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.264 2017/03/13 14:24:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.265 2017/04/01 19:35:56 riastradh Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {						\
@@ -484,9 +484,12 @@ static bool
 lfs_writevnodes_selector(void *cl, struct vnode *vp)
 {
 	struct lfs_writevnodes_ctx *c = cl;
-	struct inode *ip = VTOI(vp);
+	struct inode *ip;
 	int op = c->op;
 
+	KASSERT(mutex_owned(vp->v_interlock));
+
+	ip = VTOI(vp);
 	if (ip == NULL || vp->v_type == VNON)
 		return false;
 	if ((op == VN_DIROP && !(vp->v_uflag & VU_DIROP)) ||

Reply via email to