Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Assert write lock in wapbl_write_revocations, wapbl...



details:   https://anonhg.NetBSD.org/src/rev/9c0d345f58db
branches:  trunk
changeset: 822366:9c0d345f58db
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Mar 17 03:06:17 2017 +0000

description:
Assert write lock in wapbl_write_revocations, wapbl_write_inodes.

Only one call site, so trivial to prove correct.

diffstat:

 sys/kern/vfs_wapbl.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 092ec696f61d -r 9c0d345f58db sys/kern/vfs_wapbl.c
--- a/sys/kern/vfs_wapbl.c      Thu Mar 16 22:09:19 2017 +0000
+++ b/sys/kern/vfs_wapbl.c      Fri Mar 17 03:06:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_wapbl.c,v 1.88 2017/03/05 20:45:49 mrg Exp $       */
+/*     $NetBSD: vfs_wapbl.c,v 1.89 2017/03/17 03:06:17 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.88 2017/03/05 20:45:49 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.89 2017/03/17 03:06:17 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -2435,6 +2435,8 @@
        off_t off = *offp;
        int error;
 
+       KASSERT(rw_write_held(&wl->wl_rwlock));
+
        if (wl->wl_dealloccnt == 0)
                return 0;
 
@@ -2492,6 +2494,8 @@
        struct wapbl_ino *wi;
        int iph;
 
+       KASSERT(rw_write_held(&wl->wl_rwlock));
+
        iph = (blocklen - offsetof(struct wapbl_wc_inodelist, wc_inodes)) /
            sizeof(((struct wapbl_wc_inodelist *)0)->wc_inodes[0]);
 



Home | Main Index | Thread Index | Old Index