lkml.org 
[lkml]   [2004]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.5-rc2-mm2 ipc hang fix
badari wrote:

>--- linux/ipc/sem.c 2004-03-26 05:19:22.833959160 -0800
>+++ linux.new/ipc/sem.c 2004-03-26 05:19:57.047757872 -0800
>@@ -972,8 +972,10 @@ static struct sem_undo *find_undo(int se
> if(sma==NULL)
> goto out;
> un = ERR_PTR(-EIDRM);
>- if (sem_checkid(sma,semid))
>+ if (sem_checkid(sma,semid)) {
>+ sem_unlock(sma);
> goto out_unlock;
>+ }
> nsems = sma->sem_nsems;
> sem_unlock(sma);
>
>
[snip]

> out_unlock:
> unlock_semundo();
> out:
> return un;
> }

Thanks for finding the bug - out_unlock unlocks the wrong spinlock,
that's why I didn't notice it while searching for the bug.
But I think your fix is wrong: the "goto out_unlock" must be replaced
with "goto out": the semundo spinlock is not held.

--
Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.054 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site