Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator ...
details: https://anonhg.NetBSD.org/src/rev/b2300ad48db0
branches: trunk
changeset: 352449:b2300ad48db0
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Apr 01 19:35:56 2017 +0000
description:
KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector.
diffstat:
sys/fs/msdosfs/msdosfs_vfsops.c | 6 ++++--
sys/fs/puffs/puffs_vfsops.c | 7 +++++--
sys/fs/smbfs/smbfs_vfsops.c | 6 ++++--
sys/fs/udf/udf_subr.c | 10 +++++++---
sys/fs/udf/udf_vfsops.c | 6 ++++--
sys/fs/union/union_vfsops.c | 6 ++++--
sys/fs/v7fs/v7fs_vfsops.c | 9 ++++++---
sys/miscfs/procfs/procfs_subr.c | 10 +++++++---
sys/nfs/nfs_subs.c | 6 ++++--
sys/nfs/nfs_vfsops.c | 6 ++++--
sys/rump/librump/rumpvfs/rump_vfs.c | 6 ++++--
sys/ufs/chfs/chfs_vnode.c | 4 +++-
sys/ufs/ext2fs/ext2fs_vfsops.c | 6 ++++--
sys/ufs/ffs/ffs_snapshot.c | 6 ++++--
sys/ufs/ffs/ffs_vfsops.c | 6 ++++--
sys/ufs/lfs/lfs_segment.c | 9 ++++++---
16 files changed, 74 insertions(+), 35 deletions(-)
diffs (truncated from 441 to 300 lines):
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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 &
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/puffs/puffs_vfsops.c
--- a/sys/fs/puffs/puffs_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/puffs/puffs_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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));
}
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/smbfs/smbfs_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
{
struct smbnode *np;
+ KASSERT(mutex_owned(vp->v_interlock));
+
np = VTOSMB(vp);
if (np == NULL)
return false;
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/udf/udf_subr.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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;
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/udf/udf_vfsops.c
--- a/sys/fs/udf/udf_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/udf/udf_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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");
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/union/union_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
{
int *count = cl;
+ KASSERT(mutex_owned(vp->v_interlock));
+
*count += 1;
return false;
}
diff -r 50b7a9e00674 -r b2300ad48db0 sys/fs/v7fs/v7fs_vfsops.c
--- a/sys/fs/v7fs/v7fs_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/fs/v7fs/v7fs_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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))
diff -r 50b7a9e00674 -r b2300ad48db0 sys/miscfs/procfs/procfs_subr.c
--- a/sys/miscfs/procfs/procfs_subr.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/miscfs/procfs/procfs_subr.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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);
}
diff -r 50b7a9e00674 -r b2300ad48db0 sys/nfs/nfs_subs.c
--- a/sys/nfs/nfs_subs.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/nfs/nfs_subs.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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;
diff -r 50b7a9e00674 -r b2300ad48db0 sys/nfs/nfs_vfsops.c
--- a/sys/nfs/nfs_vfsops.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/nfs/nfs_vfsops.c Sat Apr 01 19:35:56 2017 +0000
@@ -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 @@
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);
}
diff -r 50b7a9e00674 -r b2300ad48db0 sys/rump/librump/rumpvfs/rump_vfs.c
--- a/sys/rump/librump/rumpvfs/rump_vfs.c Sat Apr 01 19:14:10 2017 +0000
+++ b/sys/rump/librump/rumpvfs/rump_vfs.c Sat Apr 01 19:35:56 2017 +0000
@@ -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>
Home |
Main Index |
Thread Index |
Old Index