public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* wait_for_completion_interruptible() changes
@ 2007-10-18 17:05 Geert Uytterhoeven
  2007-10-18 17:41 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2007-10-18 17:05 UTC (permalink / raw)
  To: Andi Kleen, Ingo Molnar; +Cc: Linux Kernel Development

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1013 bytes --]

	Hi Andi, Ingo,

Recently the return value of wait_for_completion_interruptible() in case of
succesful completion has changed:
  - in 2.6.23, it returns 0 on completion,
  - in current linux-2.6.git, it returns -1 on completion.

I.e. this breaks all code that checks for a non-zero return value instead
of explicitly comparing with -ERESTARTSYS.

I suspect this is caused by the recent completion refactoring?

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven@sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wait_for_completion_interruptible() changes
  2007-10-18 17:05 wait_for_completion_interruptible() changes Geert Uytterhoeven
@ 2007-10-18 17:41 ` Andi Kleen
  2007-10-18 19:20   ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2007-10-18 17:41 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Andi Kleen, Ingo Molnar, Linux Kernel Development

> I suspect this is caused by the recent completion refactoring?
 
Yes. Here's a patch to fix it.

Fix return value of wait_for_completion_interruptible()

The recent w_f_c() changes broke the return value of 
wait_for_completion_interruptible(). Previously it returned 0 on success,
now -1. Fix that.

Problem found by Geert Uytterhoeven

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/kernel/sched.c
===================================================================
--- linux/kernel/sched.c
+++ linux/kernel/sched.c
@@ -3751,7 +3751,10 @@ EXPORT_SYMBOL(wait_for_completion_timeou
 
 int __sched wait_for_completion_interruptible(struct completion *x)
 {
-	return wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
+	long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
+	if (t == -ERESTARTSYS) 
+		return t;
+	return 0;
 }
 EXPORT_SYMBOL(wait_for_completion_interruptible);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wait_for_completion_interruptible() changes
  2007-10-18 17:41 ` Andi Kleen
@ 2007-10-18 19:20   ` Ingo Molnar
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2007-10-18 19:20 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Geert Uytterhoeven, Linux Kernel Development


* Andi Kleen <andi@firstfloor.org> wrote:

> > I suspect this is caused by the recent completion refactoring?
>  
> Yes. Here's a patch to fix it.
> 
> Fix return value of wait_for_completion_interruptible()
> 
> The recent w_f_c() changes broke the return value of 
> wait_for_completion_interruptible(). Previously it returned 0 on 
> success, now -1. Fix that.

argh. _Please_ be a bit more careful with cleanups.

applied.

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-18 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-18 17:05 wait_for_completion_interruptible() changes Geert Uytterhoeven
2007-10-18 17:41 ` Andi Kleen
2007-10-18 19:20   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox