> > > During normal operation everything is fine. But if I fire up a new drbd
> > > device (drbdadm up res or drbdadm adjust res) sometimes (about 1 out of
> > > ten times) the machine crashes with kernel panic.
[...]
> > Last night I configured aroung 40 new drbd devices on the production
> > machine and got a crash after about 35 configured devices. I made a
> > screenshot from my kvm screen during the crash:
[...]
> This is of course very interesting, but that partial call trace is
> unfortunately useless.

I have to correct myself. That partial stack trace was sufficient to track
the issue down in the end.

Here is the patch, that fixes the issue.

-Phil
-- 
: Dipl-Ing Philipp Reisner
: LINBIT | Your Way to High Availability
: Tel: +43-1-8178292-50, Fax: +43-1-8178292-82
: http://www.linbit.com

DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.

commit a0ea28716fe86a67551950cde89dc233543ba24a
Author: Philipp Reisner <[email protected]>
Date:   Fri Jul 3 12:00:59 2009 +0200

    Fix a wronge use of kmap_atomic(..., KM_IRQ1) in the bitmap code [bugz 238]

diff --git a/drbd/drbd_bitmap.c b/drbd/drbd_bitmap.c
index 0418d8f..f27abb3 100644
--- a/drbd/drbd_bitmap.c
+++ b/drbd/drbd_bitmap.c
@@ -392,7 +392,7 @@ STATIC void bm_set_surplus(struct drbd_bitmap *b)
 	bm_unmap(p_addr);
 }
 
-STATIC unsigned long __bm_count_bits(struct drbd_bitmap *b, const int swap_endian)
+STATIC unsigned long __bm_count_bits(struct drbd_bitmap *b, const int swap_endian, const enum km_type km)
 {
 	unsigned long *p_addr, *bm, offset = 0;
 	unsigned long bits = 0;
@@ -400,7 +400,7 @@ STATIC unsigned long __bm_count_bits(struct drbd_bitmap *b, const int swap_endia
 
 	while (offset < b->bm_words) {
 		i = do_now = min_t(size_t, b->bm_words-offset, LWPP);
-		p_addr = bm_map_paddr(b, offset);
+		p_addr = __bm_map_paddr(b, offset, km);
 		bm = p_addr + MLPP(offset);
 		while (i--) {
 			catch_oob_access_start();
@@ -411,7 +411,7 @@ STATIC unsigned long __bm_count_bits(struct drbd_bitmap *b, const int swap_endia
 			bits += hweight_long(*bm++);
 			catch_oob_access_end();
 		}
-		bm_unmap(p_addr);
+		__bm_unmap(p_addr, km);
 		offset += do_now;
 	}
 
@@ -420,12 +420,12 @@ STATIC unsigned long __bm_count_bits(struct drbd_bitmap *b, const int swap_endia
 
 static unsigned long bm_count_bits(struct drbd_bitmap *b)
 {
-	return __bm_count_bits(b, 0);
+	return __bm_count_bits(b, 0, KM_IRQ1);
 }
 
 static unsigned long bm_count_bits_swap_endian(struct drbd_bitmap *b)
 {
-	return __bm_count_bits(b, 1);
+	return __bm_count_bits(b, 1, KM_USER0);
 }
 
 void _drbd_bm_recount_bits(struct drbd_conf *mdev, char *file, int line)
_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to