Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern if DIAGNOSTIC, check the size of the transaction in...
details: https://anonhg.NetBSD.org/src/rev/1e9f35b19e44
branches: trunk
changeset: 762056:1e9f35b19e44
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Feb 14 16:05:11 2011 +0000
description:
if DIAGNOSTIC, check the size of the transaction in wapbl_end().
Hopefully this will point us to the place which generaed the large
transaction, before an asynchronous panic() in wabl_end()
diffstat:
sys/kern/vfs_wapbl.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diffs (37 lines):
diff -r ae379a0cd8d6 -r 1e9f35b19e44 sys/kern/vfs_wapbl.c
--- a/sys/kern/vfs_wapbl.c Mon Feb 14 15:15:40 2011 +0000
+++ b/sys/kern/vfs_wapbl.c Mon Feb 14 16:05:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_wapbl.c,v 1.39 2011/01/08 20:37:05 christos Exp $ */
+/* $NetBSD: vfs_wapbl.c,v 1.40 2011/02/14 16:05:11 bouyer 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.39 2011/01/08 20:37:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.40 2011/02/14 16:05:11 bouyer Exp $");
#include <sys/param.h>
#include <sys/bitops.h>
@@ -901,6 +901,18 @@
wl->wl_bufbytes, wl->wl_bcount));
#endif
+#ifdef DIAGNOSTIC
+ size_t flushsize = wapbl_transaction_len(wl);
+ if (flushsize > (wl->wl_circ_size - wl->wl_reserved_bytes)) {
+ /*
+ * XXX this could be handled more gracefully, perhaps place
+ * only a partial transaction in the log and allow the
+ * remaining to flush without the protection of the journal.
+ */
+ panic("wapbl_end: current transaction too big to flush\n");
+ }
+#endif
+
mutex_enter(&wl->wl_mtx);
KASSERT(wl->wl_lock_count > 0);
wl->wl_lock_count--;
Home |
Main Index |
Thread Index |
Old Index