lkml.org 
[lkml]   [2001]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] sys_semop() EIDRM BUG fix
sys_semop() is wrong to insist that queue.status be -EIDRM when
sem_lock() fails on awakening. It is quite normal for update_queue()
to have set status 0, removed process from queue and woken it; but
IPC_RMID come in before that process gets to run (or to lock) -
since process already off queue, its status is not set to -EIDRM.
If we want a safety check here, check removed from queue instead.
Return original status or -EIDRM? Checked other OSes, use -EIDRM.

diff -urN linux-2.4.2-pre4/ipc/sem.c linux/ipc/sem.c
--- linux-2.4.2-pre4/ipc/sem.c Sat Feb 17 11:14:27 2001
+++ linux/ipc/sem.c Sun Feb 18 08:21:37 2001
@@ -922,7 +922,7 @@

tmp = sem_lock(semid);
if(tmp==NULL) {
- if(queue.status != -EIDRM)
+ if(queue.prev != NULL)
BUG();
current->semsleeping = NULL;
error = -EIDRM;
-
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 13:15    [W:0.133 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site