Module Name:    src
Committed By:   hannken
Date:           Wed Feb 16 19:43:06 UTC 2011

Modified Files:
        src/sys/kern: vfs_wapbl.c

Log Message:
Set the limit for deallocations in one transaction to a more realistic
(and much lower) value.  When flushing the log these deallocations will
produce new blocks and that may execeed the journal size resulting in
a "wapbl_flush: current transaction too big to flush" panic.
Seen when removing a large snapshot.

Adresses PR #44568 (WAPBL doens't play nice with snapshots).


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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.40 src/sys/kern/vfs_wapbl.c:1.41
--- src/sys/kern/vfs_wapbl.c:1.40	Mon Feb 14 16:05:11 2011
+++ src/sys/kern/vfs_wapbl.c	Wed Feb 16 19:43:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.40 2011/02/14 16:05:11 bouyer Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.41 2011/02/16 19:43:05 hannken 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.40 2011/02/14 16:05:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.41 2011/02/16 19:43:05 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -479,7 +479,7 @@
 	wl->wl_bufcount_max = (nbuf / 2) * 1024;
 
 	/* XXX tie this into resource estimation */
-	wl->wl_dealloclim = 2 * btodb(wl->wl_bufbytes_max);
+	wl->wl_dealloclim = wl->wl_bufbytes_max / mp->mnt_stat.f_bsize / 2;
 	
 	wl->wl_deallocblks = wapbl_malloc(sizeof(*wl->wl_deallocblks) *
 	    wl->wl_dealloclim);

Reply via email to