[PATCH] kmod-v5.c

PARMELAN Edouard (parmee@postecss.ncrfran.france.ncr.com)
Fri, 10 Apr 98 10:04:00 PDT


Hi Greg,

The following patch remove dowm() and up() for queue_access
in run_modprobe(): slot is the argument passed by kernel_thread().

Edouard.Parmelan@France.NCR.COM
[[ KMOD-V~1.PAT : 2062 dans KMOD-V~1.PAT ]]

----------
De : owner-linux-kernel-outgoing
Date : jeudi 9 avril 1998 16:33
A : Petr Vandrovec Ing. VTEI
Cc : linux-kernel
Objet : Re: kmod races

WWIS MIME Decoded (2.C) on <ncrfran>, message parts:
part1.ukn (TEXT/PLAIN)
------------------------------

This is a known problem and is being worked on. If you would like to try
a different kmod that gets around these problems, go to
http://athena.res.cmu.edu/kmod/ and pull down kmod.c.v5 - it's a drop-in
replacement for any 2.1.9x kmod.c. It is still in testing and has some
rough edges, but the sooner we get more testers to confirm it works in
all
cases, the sooner it'll go to Linus for inclusion.

Greg Zornetzer - gaz+@andrew.cmu.edu
"Light shines brightest in the darkest night"
http://www.contrib.andrew.cmu.edu/~gaz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
the body of a message to majordomo@vger.rutgers.edu

--- kmod-v5.c.orig Thu Apr 09 14:57:29 1998
+++ kmod-v5.c Fri Apr 10 09:55:33 1998
@@ -102,14 +102,8 @@
}

int run_modprobe(void *data) {
- struct modslot *slot;
+ struct modslot *slot = data;
int err;
- down(&queue_access);
- for(slot = modlist; (slot != NULL) && (slot->info != MODRQ_SERVICING); slot = slot->next);
- if(slot == NULL)
- return(0);
- slot->info = MODRQ_CLEANUP;
- up(&queue_access);
err = execve(modprobe_path, slot->argv, envp);
printk("Modprobe load failed - couldn't load %s\n", slot->module_name);
printk("Error code %d\n",err);
@@ -134,8 +128,8 @@
flush_signals(current);
for(slot = modlist; slot != NULL; slot=slot->next) {
if (slot->info & MODRQ_REQUESTED) {
- slot->info = MODRQ_SERVICING;
- slot->pid = kernel_thread(run_modprobe,NULL,SIGCHLD);
+ slot->info = MODRQ_CLEANUP;
+ slot->pid = kernel_thread(run_modprobe,slot,SIGCHLD);
if(slot->pid < 1) {
printk("KMod: Kernel Thread Spawn failed: couldn't load %s\n",slot->module_name);
slot->info = MODRQ_FAILURE;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu