[DRBD-user] DRBD 0.7-pre8 Kernel 2.4.X oops problem

Lars Ellenberg lars.ellenberg at linbit.com
Tue Jun 29 13:41:14 CEST 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Tue, Jun 29, 2004 at 12:34:44AM +0200, Lars Ellenberg wrote:
> 
> 
> as someone else already pointed out:
> our definitions for the DEFINE_WAIT marco, as well as the
> prepare_to_wait and _finish_wait functions, are the problem here.
> 
> 
> DEFINE_WAIT is maped to DECLARE_WAIT, which initializes
> w.task_list.{prev,next} == NULL, thus list_empty(&wait->task_list) is
> false, and the wait thingy is never added to the list in
> prepare_to_wait --- but it is removed later in finish_wait, where the
> NULL dereference happens.
> 
> in 2.6 this problem does not occur,
> since there "list_empty_careful" is used...
> 
> 
> anyways, this should help
> (untested...  I'm not at my own work place,
> and currently I can not even do a test compile ...)
> 
> 	lge
> 
> Index: drbd_receiver.c
> ===================================================================
> RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_receiver.c,v
> retrieving revision 1.97.2.175
> diff -u -p -r1.97.2.175 drbd_receiver.c
> --- drbd_receiver.c	26 Jun 2004 08:05:40 -0000	1.97.2.175
> +++ drbd_receiver.c	28 Jun 2004 22:20:14 -0000
> @@ -267,7 +267,10 @@ STATIC void finish_wait(wait_queue_head_
>  	spin_unlock_irqrestore(&q->lock, flags);
>  }
>  
> -#define DEFINE_WAIT(name)	DECLARE_WAITQUEUE(name,current)
> +#define DEFINE_WAIT(name)	do {	\
> +	DECLARE_WAITQUEUE(name,current);\
> +	list_init(&name.task_list);	\
> +} while (0)
>  
>  #endif

nonsense, obviously the "DECLARE" would be valid only in the do {} block
scope. it has been very late, this morning...

correct patch will follow soonish...

	lge



More information about the drbd-user mailing list