[DRBD-cvs] svn commit by lars - r2497 - branches/drbd-0.7/drbd - doh. spin_lock_irq(A); spin_lock_irq(B); spin_unlock_ir

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Oct 3 18:36:19 CEST 2006


Author: lars
Date: 2006-10-03 18:36:19 +0200 (Tue, 03 Oct 2006)
New Revision: 2497

Modified:
   branches/drbd-0.7/drbd/drbd_bitmap.c
Log:
doh. spin_lock_irq(A); spin_lock_irq(B); spin_unlock_irq(B); *deadlock on A in irq*; spin_unlock_irq(A);... again...

Modified: branches/drbd-0.7/drbd/drbd_bitmap.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_bitmap.c	2006-10-03 14:41:57 UTC (rev 2496)
+++ branches/drbd-0.7/drbd/drbd_bitmap.c	2006-10-03 16:36:19 UTC (rev 2497)
@@ -813,6 +813,7 @@
 int drbd_bm_set_bit(drbd_dev *mdev, const unsigned long bitnr)
 {
 	struct drbd_bitmap *b = mdev->bitmap;
+	unsigned long flags;
 	int i;
 	ERR_IF(!b) return 1;
 	ERR_IF(!b->bm) return 1;
@@ -828,7 +829,7 @@
 		ERR("%s in drbd_bm_set_bit\n", cstate_to_name(mdev->cstate));
 */
 
-	spin_lock_irq(&b->bm_lock);
+	spin_lock_irqsave(&b->bm_lock,flags);
 	BM_PARANOIA_CHECK();
 	MUST_NOT_BE_LOCKED();
 	ERR_IF (bitnr >= b->bm_bits) {
@@ -838,7 +839,7 @@
 		i = (0 != __test_and_set_bit(bitnr, b->bm));
 		b->bm_set += !i;
 	}
-	spin_unlock_irq(&b->bm_lock);
+	spin_unlock_irqrestore(&b->bm_lock,flags);
 	return i;
 }
 



More information about the drbd-cvs mailing list