From: Scott Maxwell <maxwell@ScottMaxwell.org>
To: linux-kernel@vger.kernel.org
Cc: manfreds@colorfullife.com
Subject: [PATCH] SysV IPC, kernel 2.4.3
Date: Wed, 04 Apr 2001 22:41:44 -0700 [thread overview]
Message-ID: <3ACC0598.5154A28E@ScottMaxwell.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 951 bytes --]
This patch contains several small bug fixes and micro-optimizations
for SysV IPC code in the 2.4.3 kernel. Summary:
* testmsg(): "return expr;" beats "if (expr) return 1; ... return 0;"
* pipelined_send() was setting q_lspid instead of q_lrpid.
* sys_msgrcv() had redundant found_msg assignments.
* freeundos() had unused parameter (sma).
* ipc_alloc(): Kernel oops if initial allocation failed.
I'm having unrelated problems getting 2.4.3 to work with my test
hardware, so I have tested these changes under 2.4.1 only. They work
fine for me under 2.4.1, though. Please email me if you see any
problems or if Netscape mail mangles this post (I haven't tried this
before). Thanks.
--
-------------------------+--------------------------------------------
R H L U Scott Maxwell: | ``Life results from the non-random survival
E A I X maxwell@ | of randomly varying replicators.''
D T N 6 ScottMaxwell.org | -- Richard Dawkins
[-- Attachment #2: ipc-microfixes-2.4.3.patch --]
[-- Type: text/plain, Size: 1981 bytes --]
diff -urN linux-2.4.3/ipc/msg.c linux/ipc/msg.c
--- linux-2.4.3/ipc/msg.c Mon Feb 19 10:18:18 2001
+++ linux/ipc/msg.c Wed Apr 4 00:38:21 2001
@@ -582,17 +582,11 @@
case SEARCH_ANY:
return 1;
case SEARCH_LESSEQUAL:
- if(msg->m_type <=type)
- return 1;
- break;
+ return msg->m_type <=type;
case SEARCH_EQUAL:
- if(msg->m_type == type)
- return 1;
- break;
+ return msg->m_type == type;
case SEARCH_NOTEQUAL:
- if(msg->m_type != type)
- return 1;
- break;
+ return msg->m_type != type;
}
return 0;
}
@@ -613,7 +607,8 @@
wake_up_process(msr->r_tsk);
} else {
msr->r_msg = msg;
- msq->q_lspid = msr->r_tsk->pid;
+ /* Was q_lspid; surely, this was the intent. */
+ msq->q_lrpid = msr->r_tsk->pid;
msq->q_rtime = CURRENT_TIME;
wake_up_process(msr->r_tsk);
return 1;
@@ -753,10 +748,8 @@
if(testmsg(msg,msgtyp,mode)) {
found_msg = msg;
if(mode == SEARCH_LESSEQUAL && msg->m_type != 1) {
- found_msg=msg;
msgtyp=msg->m_type-1;
} else {
- found_msg=msg;
break;
}
}
diff -urN linux-2.4.3/ipc/sem.c linux/ipc/sem.c
--- linux-2.4.3/ipc/sem.c Mon Feb 19 10:18:18 2001
+++ linux/ipc/sem.c Mon Apr 2 20:51:37 2001
@@ -775,7 +775,7 @@
}
}
-static struct sem_undo* freeundos(struct sem_array *sma, struct sem_undo* un)
+static struct sem_undo* freeundos(struct sem_undo* un)
{
struct sem_undo* u;
struct sem_undo** up;
@@ -878,7 +878,7 @@
if(un->semid==semid)
break;
if(un->semid==-1)
- un=freeundos(sma,un);
+ un=freeundos(un);
else
un=un->proc_next;
}
diff -urN linux-2.4.3/ipc/util.c linux/ipc/util.c
--- linux-2.4.3/ipc/util.c Mon Feb 19 10:18:18 2001
+++ linux/ipc/util.c Mon Apr 2 20:39:55 2001
@@ -75,7 +75,8 @@
ids->size = 0;
}
ids->ary = SPIN_LOCK_UNLOCKED;
- for(i=0;i<size;i++)
+ /* Was looping i=[0..size], causing kernel panic if alloc failed. */
+ for(i=0;i<ids->size;i++)
ids->entries[i].p = NULL;
}
reply other threads:[~2001-04-05 5:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ACC0598.5154A28E@ScottMaxwell.org \
--to=maxwell@scottmaxwell.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfreds@colorfullife.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox