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().


---

 25-akpm/ipc/sem.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff -puN ipc/sem.c~ipc-locking-fix ipc/sem.c
--- 25/ipc/sem.c~ipc-locking-fix	2004-03-26 09:58:54.761953600 -0800
+++ 25-akpm/ipc/sem.c	2004-03-26 09:58:54.764953144 -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))
-		goto out_unlock;
+	if (sem_checkid(sma,semid)) {
+		sem_unlock(sma);
+		goto out;
+	}
 	nsems = sma->sem_nsems;
 	sem_unlock(sma);
 
@@ -1004,7 +1006,6 @@ static struct sem_undo *find_undo(int se
 	sma->undo = new;
 	sem_unlock(sma);
 	un = new;
-out_unlock:
 	unlock_semundo();
 out:
 	return un;

_