Module Name: src Committed By: riastradh Date: Fri Mar 17 03:06:17 UTC 2017
Modified Files: src/sys/kern: vfs_wapbl.c Log Message: Assert write lock in wapbl_write_revocations, wapbl_write_inodes. Only one call site, so trivial to prove correct. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/kern/vfs_wapbl.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/kern/vfs_wapbl.c diff -u src/sys/kern/vfs_wapbl.c:1.88 src/sys/kern/vfs_wapbl.c:1.89 --- src/sys/kern/vfs_wapbl.c:1.88 Sun Mar 5 20:45:49 2017 +++ src/sys/kern/vfs_wapbl.c Fri Mar 17 03:06:17 2017 @@ -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 @@ wapbl_write_revocations(struct wapbl *wl off_t off = *offp; int error; + KASSERT(rw_write_held(&wl->wl_rwlock)); + if (wl->wl_dealloccnt == 0) return 0; @@ -2492,6 +2494,8 @@ wapbl_write_inodes(struct wapbl *wl, off 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]);