Re: 2.6.5-rc2-mm2 ipc hang fix

From: Manfred Spraul
Date: Fri Mar 26 2004 - 01:03:20 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/