Skip to contentSkip to conversation

Module rewrite 15/20: Forced Unload Support

PATCH New Rusty Russell 1 participant 1 message Sep 25, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Module rewrite 15/20: Forced Unload Support

Name: Forced Module Unload
Author: Rusty Russell
Status: Experimental
Depends: Module/module-license.patch.gz

D: Allows the (very dangerous!) "rmmod -f" for kernel developers and
D: desperate people. It is currently under CONFIG_DEBUG_KERNEL, but it
D: could be moved out.

arch/i386/Config.help +7 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .10910-linux-2.5.38/arch/i386/Config.help .10910-linux-2.5.38.updated/arch/i386/Config.help
@@ -976,3 +976,10 @@ CONFIG_SOFTWARE_SUSPEND
   absence of features.
 
   For more information take a look at Documentation/swsusp.txt.
+
+CONFIG_MODULE_FORCE_UNLOAD
+  This option allows you to force a module to unload, even if the
+  kernel believes it is unsafe: the kernel will remove the module
+  without waiting for anyone to stop using it (using the -F option to
+  rmmod).  This is mainly for kernel developers.  In unsure, say N.
+
arch/i386/config.in +1 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .10910-linux-2.5.38/arch/i386/config.in .10910-linux-2.5.38.updated/arch/i386/config.in
@@ -436,6 +436,7 @@ if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; th
    if [ "$CONFIG_HIGHMEM" = "y" ]; then
       bool '  Highmem debugging' CONFIG_DEBUG_HIGHMEM
    fi
+   dep_bool '  Forced module removal' CONFIG_MODULE_FORCE_UNLOAD $CONFIG_MODULE_UNLOAD
 fi
 
 if [ "$CONFIG_X86_LOCAL_APIC" = "y" ]; then
include/linux/kernel.h +1 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .10910-linux-2.5.38/include/linux/kernel.h .10910-linux-2.5.38.updated/include/linux/kernel.h
@@ -95,6 +95,7 @@ extern const char *print_tainted(void);
 #define TAINT_PROPRIETORY_MODULE	(1<<0)
 #define TAINT_FORCED_MODULE		(1<<1)
 #define TAINT_UNSAFE_SMP		(1<<2)
+#define TAINT_FORCED_RMMOD		(1<<3)
 
 extern void dump_stack(void);
 
init/Config.help +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .10910-linux-2.5.38/init/Config.help .10910-linux-2.5.38.updated/init/Config.help
@@ -93,7 +93,7 @@ CONFIG_MODULES
 
 CONFIG_MODULE_UNLOAD
   Without this option you will not be able to unload any modules (note
-  that some modules may not be unloadable anyway).  This makes your
+  that some modules may not be unloadable anyway), which makes your
   kernel slightly smaller and simpler.  If unsure, say Y.
 
 CONFIG_OBSOLETE_MODPARM
kernel/module.c +46 -18

96 lines not on this page · raw message

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.