Skip to content

Instantly share code, notes, and snippets.

@coypoop
Last active May 11, 2016 10:18
Show Gist options
  • Save coypoop/87a9248dbb776c7881bb408c3757f378 to your computer and use it in GitHub Desktop.
Save coypoop/87a9248dbb776c7881bb408c3757f378 to your computer and use it in GitHub Desktop.
From d51a64a5e9a15169949b8f1442c79060c157536d Mon Sep 17 00:00:00 2001
From: coypu <coypu@sdf.org>
Date: Wed, 11 May 2016 13:08:06 +0300
Subject: [PATCH 1/1] assert wl_mtx held in wapbl_transaction_len (debug only)
---
sys/kern/vfs_wapbl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/kern/vfs_wapbl.c b/sys/kern/vfs_wapbl.c
index e63f228..e317daf 100644
--- a/sys/kern/vfs_wapbl.c
+++ b/sys/kern/vfs_wapbl.c
@@ -2098,6 +2098,9 @@ wapbl_transaction_len(struct wapbl *wl)
sizeof(((struct wapbl_wc_blocklist *)0)->wc_blocks[0]);
KASSERT(bph > 0);
+#ifdef WAPBL_DEBUG /* XXX: get rid of this ifdef eventually */
+ KASSERT(mutex_owned(&wl->wl_mtx));
+#endif
len = wl->wl_bcount;
len += howmany(wl->wl_bufcount, bph) * blocklen;
--
2.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment