Commit c9503ff2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ipc locking fix

From: badari <pbadari@us.ibm.com>

I ran into an ipc hang while trying to shutdown a database.  The problem is
due to missing sem_unlock() in find_undo().
parent 66154b6e
...@@ -972,8 +972,10 @@ static struct sem_undo *find_undo(int semid) ...@@ -972,8 +972,10 @@ static struct sem_undo *find_undo(int semid)
if(sma==NULL) if(sma==NULL)
goto out; goto out;
un = ERR_PTR(-EIDRM); un = ERR_PTR(-EIDRM);
if (sem_checkid(sma,semid)) if (sem_checkid(sma,semid)) {
goto out_unlock; sem_unlock(sma);
goto out;
}
nsems = sma->sem_nsems; nsems = sma->sem_nsems;
sem_unlock(sma); sem_unlock(sma);
...@@ -1004,7 +1006,6 @@ static struct sem_undo *find_undo(int semid) ...@@ -1004,7 +1006,6 @@ static struct sem_undo *find_undo(int semid)
sma->undo = new; sma->undo = new;
sem_unlock(sma); sem_unlock(sma);
un = new; un = new;
out_unlock:
unlock_semundo(); unlock_semundo();
out: out:
return un; return un;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment