[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drbd-cvs
Subject:    [DRBD-cvs] drbd by lars; * remove one PARANOIA BUG, sync is no lo...
From:       drbd-cvs () linbit ! com
Date:       2004-04-30 10:08:51
Message-ID: 20040430100851.F288B15DF5C () garcon ! linbit ! com
[Download RAW message or body]

DRBD CVS committal

Author  : lars
Module  : drbd

Dir     : drbd/drbd


Modified Files:
      Tag: rel-0_7-branch
	drbd_dsender.c drbd_int.h 


Log Message:
* remove one PARANOIA BUG,
  sync is no longer the only work that may be queued.

* assert worker.t_state == Running in *drbd_queue_work*
  including dump_stack();

  I don't see the exact spot yet, but I think the real problem here is
  that without proper locking on the state information in mdev, our
  threads won't ever have a consistent view of the state.

  maybe it is enough to *first* set the new state,
  and then do the transition?

  or set an extra transition flag?

  or put a read/write lock on mdev...
  this is my favorite, but needs considerable review of the code, and
  will at first introduce "new" problems in all those places where it
  now would "just work" most of the time.
  

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_dsender.c,v
retrieving revision 1.1.2.95
retrieving revision 1.1.2.96
diff -u -3 -r1.1.2.95 -r1.1.2.96
--- drbd_dsender.c	29 Apr 2004 14:48:20 -0000	1.1.2.95
+++ drbd_dsender.c	30 Apr 2004 10:08:46 -0000	1.1.2.96
@@ -771,7 +771,9 @@
 	     side == SyncTarget ? "target" : "source", 
 	     (unsigned long) mdev->rs_left>>1);
 
-	PARANOIA_BUG_ON(!list_empty(&mdev->resync_work.list));
+	/* no longer true since we queue the write hints here, too
+	  PARANOIA_BUG_ON(!list_empty(&mdev->resync_work.list));
+	*/
 	PARANOIA_BUG_ON(mdev->resync_work.cb != w_resync_inactive);
 
 	if ( mdev->rs_left == 0 ) {
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_int.h,v
retrieving revision 1.58.2.149
retrieving revision 1.58.2.150
diff -u -3 -r1.58.2.149 -r1.58.2.150
--- drbd_int.h	29 Apr 2004 14:43:26 -0000	1.58.2.149
+++ drbd_int.h	30 Apr 2004 10:08:46 -0000	1.58.2.150
@@ -1005,6 +1005,10 @@
 static inline void
 _drbd_queue_work(struct drbd_work_queue *q, struct drbd_work *w)
 {
+	drbd_dev *mdev = container_of(q,struct Drbd_Conf,data.work);
+	D_ASSERT(IS_VALID_MDEV(mdev));
+	ERR_IF(mdev->worker.t_state != Running)
+		dump_stack();
 	list_add_tail(&w->list,&q->q);
 	up(&q->s);
 }
@@ -1012,6 +1016,10 @@
 static inline void
 _drbd_queue_work_front(struct drbd_work_queue *q, struct drbd_work *w)
 {
+	drbd_dev *mdev = container_of(q,struct Drbd_Conf,data.work);
+	D_ASSERT(IS_VALID_MDEV(mdev));
+	ERR_IF(mdev->worker.t_state != Running)
+		dump_stack();
 	list_add(&w->list,&q->q);
 	up(&q->s);
 }
@@ -1022,6 +1030,8 @@
 {
 	unsigned long flags;
 	spin_lock_irqsave(&mdev->req_lock,flags);
+	ERR_IF(mdev->worker.t_state != Running)
+		dump_stack();
 	list_add_tail(&w->list,&q->q);
 	spin_unlock_irqrestore(&mdev->req_lock,flags);
 	up(&q->s);



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic