[DRBD-cvs] svn commit by phil - r1985 - branches/drbd-0.7/drbd - Fixed a self made SMP lockup; showing up in drbd_al_com

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Oct 17 15:40:12 CEST 2005


Author: phil
Date: 2005-10-17 15:40:11 +0200 (Mon, 17 Oct 2005)
New Revision: 1985

Modified:
   branches/drbd-0.7/drbd/drbd_bitmap.c
Log:
Fixed a self made SMP lockup; showing up in drbd_al_complete_io()

  With drbd-0.7.12 we moved the al_lock before the bm_clear_bit()
  in  __drbd_set_in_sync(). That by itself is okay, but 
  in bm_clear_bit() we used the spin_[un]lock_irq() functions,
  therefore reenabling interrupts...
  This is fixed now.



Modified: branches/drbd-0.7/drbd/drbd_bitmap.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_bitmap.c	2005-10-08 07:26:51 UTC (rev 1984)
+++ branches/drbd-0.7/drbd/drbd_bitmap.c	2005-10-17 13:40:11 UTC (rev 1985)
@@ -850,11 +850,12 @@
 int drbd_bm_clear_bit(drbd_dev *mdev, const unsigned long bitnr)
 {
 	struct drbd_bitmap *b = mdev->bitmap;
+	unsigned long flags;
 	int i;
 	ERR_IF(!b) return 0;
 	ERR_IF(!b->bm) return 0;
 
-	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) {
@@ -864,7 +865,7 @@
 		i = (0 != __test_and_clear_bit(bitnr, b->bm));
 		b->bm_set -= i;
 	}
-	spin_unlock_irq(&b->bm_lock);
+	spin_unlock_irqrestore(&b->bm_lock,flags);
 
 	/* clearing bits should only take place when sync is in progress!
 	 * this is only called from drbd_set_in_sync.



More information about the drbd-cvs mailing list