Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/miscfs/genfs assert that WAPBL journal write lock is act...
details: https://anonhg.NetBSD.org/src/rev/6eeec513d83e
branches: trunk
changeset: 995178:6eeec513d83e
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Dec 10 21:10:52 2018 +0000
description:
assert that WAPBL journal write lock is actually held when called with
PGO_JOURNALLOCKED or IO_JOURNALLOCKED
suggested by mrg@, thanks
diffstat:
sys/miscfs/genfs/genfs_io.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diffs (54 lines):
diff -r bfcad7d18617 -r 6eeec513d83e sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c Mon Dec 10 21:03:48 2018 +0000
+++ b/sys/miscfs/genfs/genfs_io.c Mon Dec 10 21:10:52 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_io.c,v 1.73 2018/12/09 20:32:37 jdolecek Exp $ */
+/* $NetBSD: genfs_io.c,v 1.74 2018/12/10 21:10:52 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.73 2018/12/09 20:32:37 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.74 2018/12/10 21:10:52 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -141,6 +141,11 @@
KASSERT(vp->v_type == VREG || vp->v_type == VDIR ||
vp->v_type == VLNK || vp->v_type == VBLK);
+#ifdef DIAGNOSTIC
+ if ((flags & PGO_JOURNALLOCKED) && vp->v_mount->mnt_wapbl)
+ WAPBL_JLOCK_ASSERT(vp->v_mount);
+#endif
+
error = vdead_check(vp, VDEAD_NOWAIT);
if (error) {
if ((flags & PGO_LOCKED) == 0)
@@ -869,6 +874,11 @@
UVMHIST_LOG(ubchist, "vp %#jx pages %jd off 0x%jx len 0x%jx",
(uintptr_t)vp, uobj->uo_npages, startoff, endoff - startoff);
+#ifdef DIAGNOSTIC
+ if ((origflags & PGO_JOURNALLOCKED) && vp->v_mount->mnt_wapbl)
+ WAPBL_JLOCK_ASSERT(vp->v_mount);
+#endif
+
trans_mp = NULL;
holds_wapbl = false;
@@ -1714,6 +1724,11 @@
bool need_wapbl = (vp->v_mount && vp->v_mount->mnt_wapbl &&
(ioflag & IO_JOURNALLOCKED) == 0);
+#ifdef DIAGNOSTIC
+ if ((ioflag & IO_JOURNALLOCKED) && vp->v_mount->mnt_wapbl)
+ WAPBL_JLOCK_ASSERT(vp->v_mount);
+#endif
+
/*
* We only support direct I/O to user space for now.
*/
Home |
Main Index |
Thread Index |
Old Index