Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs make UFS_WAPBL_JLOCK_ASSERT() #ifdef DIAGNOSTIC, sam...
details: https://anonhg.NetBSD.org/src/rev/a74086512d65
branches: trunk
changeset: 995174:a74086512d65
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Dec 10 19:29:41 2018 +0000
description:
make UFS_WAPBL_JLOCK_ASSERT() #ifdef DIAGNOSTIC, same as the underlying
function KASSERT(), so that it actually does something; fix code using
it to actually pass correct params, so that it compiles
remove UFS_WAPBL_JUNLOCK_ASSERT(), as that is inherently racy (it's
okay on those places if the rwlock is held by other lwp); depend
on the RW_ASSERT()/LOCKDEBUG inside rw_enter() to catch the case
with wapbl rwlock held by current lwp
diffstat:
sys/ufs/ffs/ffs_alloc.c | 6 ++----
sys/ufs/ffs/ffs_inode.c | 6 +++---
sys/ufs/ffs/ffs_vfsops.c | 6 +++---
sys/ufs/ffs/ffs_wapbl.c | 6 +++---
sys/ufs/ufs/ufs_inode.c | 8 ++------
sys/ufs/ufs/ufs_readwrite.c | 5 ++---
sys/ufs/ufs/ufs_vnops.c | 8 ++------
sys/ufs/ufs/ufs_wapbl.h | 8 ++------
8 files changed, 19 insertions(+), 34 deletions(-)
diffs (239 lines):
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ffs/ffs_alloc.c
--- a/sys/ufs/ffs/ffs_alloc.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ffs/ffs_alloc.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_alloc.c,v 1.161 2018/09/03 16:29:37 riastradh Exp $ */
+/* $NetBSD: ffs_alloc.c,v 1.162 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.161 2018/09/03 16:29:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.162 2018/12/10 19:29:41 jdolecek Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -566,8 +566,6 @@
ino_t ino, ipref;
int cg, error;
- UFS_WAPBL_JUNLOCK_ASSERT(pvp->v_mount);
-
pip = VTOI(pvp);
fs = pip->i_fs;
ump = pip->i_ump;
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ffs/ffs_inode.c
--- a/sys/ufs/ffs/ffs_inode.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ffs/ffs_inode.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_inode.c,v 1.124 2017/03/18 05:26:40 riastradh Exp $ */
+/* $NetBSD: ffs_inode.c,v 1.125 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.124 2017/03/18 05:26:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.125 2018/12/10 19:29:41 jdolecek Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -220,7 +220,7 @@
struct ufsmount *ump = oip->i_ump;
void *dcookie;
- UFS_WAPBL_JLOCK_ASSERT(ip->i_ump->um_mountp);
+ UFS_WAPBL_JLOCK_ASSERT(ump->um_mountp);
if (ovp->v_type == VCHR || ovp->v_type == VBLK ||
ovp->v_type == VFIFO || ovp->v_type == VSOCK) {
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.359 2018/12/10 14:46:24 maxv Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.360 2018/12/10 19:29:41 jdolecek 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.359 2018/12/10 14:46:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.360 2018/12/10 19:29:41 jdolecek Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -2334,7 +2334,7 @@
void *space;
int i, size, error = 0, allerror = 0;
- UFS_WAPBL_JLOCK_ASSERT(mp);
+ UFS_WAPBL_JLOCK_ASSERT(mp->um_mountp);
allerror = ffs_sbupdate(mp, waitfor);
blks = howmany(fs->fs_cssize, fs->fs_fsize);
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_wapbl.c,v 1.42 2018/09/03 16:29:37 riastradh Exp $ */
+/* $NetBSD: ffs_wapbl.c,v 1.43 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.42 2018/09/03 16:29:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.43 2018/12/10 19:29:41 jdolecek Exp $");
#define WAPBL_INTERNAL
@@ -176,7 +176,7 @@
int error __diagused;
struct wapbl_dealloc *wd;
- UFS_WAPBL_JLOCK_ASSERT(mp);
+ UFS_WAPBL_JLOCK_ASSERT(ump->um_mountp);
#ifdef WAPBL_DEBUG_INODES
ufs_wapbl_verify_inodes(mp, __func__);
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ufs/ufs_inode.c
--- a/sys/ufs/ufs/ufs_inode.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ufs/ufs_inode.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_inode.c,v 1.103 2018/01/28 10:01:18 hannken Exp $ */
+/* $NetBSD: ufs_inode.c,v 1.104 2018/12/10 19:29:41 jdolecek Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.103 2018/01/28 10:01:18 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.104 2018/12/10 19:29:41 jdolecek Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -86,8 +86,6 @@
int allerror = 0, error;
bool wapbl_locked = false;
- UFS_WAPBL_JUNLOCK_ASSERT(mp);
-
/*
* Ignore inodes related to stale file handles.
*/
@@ -298,8 +296,6 @@
struct mount *mp = vp->v_mount;
int error = 0;
- UFS_WAPBL_JUNLOCK_ASSERT(mp);
-
/*
* Truncate might temporarily fail, loop until done.
*/
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ufs/ufs_readwrite.c
--- a/sys/ufs/ufs/ufs_readwrite.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ufs/ufs_readwrite.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_readwrite.c,v 1.121 2017/03/01 10:42:45 hannken Exp $ */
+/* $NetBSD: ufs_readwrite.c,v 1.122 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.121 2017/03/01 10:42:45 hannken Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.122 2018/12/10 19:29:41 jdolecek Exp $");
#ifdef LFS_READWRITE
#define FS struct lfs
@@ -291,7 +291,6 @@
KASSERT(uio->uio_rw == UIO_WRITE);
KASSERT(vp->v_type == VREG);
KASSERT(!ISSET(ioflag, IO_JOURNALLOCKED));
- UFS_WAPBL_JUNLOCK_ASSERT(vp->v_mount);
if (ioflag & IO_APPEND)
uio->uio_offset = ip->i_size;
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_vnops.c,v 1.239 2017/10/28 00:37:13 pgoyette Exp $ */
+/* $NetBSD: ufs_vnops.c,v 1.240 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.239 2017/10/28 00:37:13 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.240 2018/12/10 19:29:41 jdolecek Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -460,8 +460,6 @@
return (EINVAL);
}
- UFS_WAPBL_JUNLOCK_ASSERT(vp->v_mount);
-
if (vap->va_flags != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY) {
error = EROFS;
@@ -1781,8 +1779,6 @@
struct vnode *tvp;
int error;
- UFS_WAPBL_JUNLOCK_ASSERT(dvp->v_mount);
-
error = vcache_new(dvp->v_mount, dvp, vap, cnp->cn_cred, &tvp);
if (error)
return error;
diff -r f68ffedc97ff -r a74086512d65 sys/ufs/ufs/ufs_wapbl.h
--- a/sys/ufs/ufs/ufs_wapbl.h Mon Dec 10 19:21:56 2018 +0000
+++ b/sys/ufs/ufs/ufs_wapbl.h Mon Dec 10 19:29:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_wapbl.h,v 1.14 2016/11/11 22:59:26 jdolecek Exp $ */
+/* $NetBSD: ufs_wapbl.h,v 1.15 2018/12/10 19:29:41 jdolecek Exp $ */
/*-
* Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -131,14 +131,11 @@
UFS_UPDATE(vp, access, modify, flags); \
}
-#ifdef UFS_WAPBL_DEBUG_JLOCK
+#ifdef DIAGNOSTIC
#define UFS_WAPBL_JLOCK_ASSERT(mp) \
if (mp->mnt_wapbl) wapbl_jlock_assert(mp->mnt_wapbl)
-#define UFS_WAPBL_JUNLOCK_ASSERT(mp) \
- if (mp->mnt_wapbl) wapbl_junlock_assert(mp->mnt_wapbl)
#else
#define UFS_WAPBL_JLOCK_ASSERT(mp)
-#define UFS_WAPBL_JUNLOCK_ASSERT(mp)
#endif
#define UFS_WAPBL_REGISTER_INODE(mp, ino, mode) \
@@ -168,7 +165,6 @@
#define UFS_WAPBL_END(mp) do { } while (0)
#define UFS_WAPBL_UPDATE(vp, access, modify, flags) do { } while (0)
#define UFS_WAPBL_JLOCK_ASSERT(mp)
-#define UFS_WAPBL_JUNLOCK_ASSERT(mp)
#define UFS_WAPBL_REGISTER_INODE(mp, ino, mode) do { } while (0)
#define UFS_WAPBL_UNREGISTER_INODE(mp, ino, mode) do { } while (0)
#define UFS_WAPBL_REGISTER_DEALLOCATION(mp, blk, len, cookiep) 0
Home |
Main Index |
Thread Index |
Old Index