Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.19 /kernel/kmod.c

Filename:/kernel/kmod.c
Lines Added:8
Lines Deleted:0
Also changed in: (Previous) 2.4.19-rc5-ac1  2.4.19-rc5  2.4.19-rc4  2.4.19-rc3-ac5  2.4.19-rc3-ac4  2.4.19-rc3-ac3 
(Following) 2.4.19-ac1  2.4.19-ac2  2.4.19-ac3  2.4.19-ac4  2.4.20-pre1-ac1  2.4.20-pre1-ac2 

Location
[  2.4.19
  [  kernel
     o  kmod.c

Patch

diff -urN linux-2.4.18/kernel/kmod.c linux-2.4.19/kernel/kmod.c
--- linux-2.4.18/kernel/kmod.c   Tue Jul 17 18:23:50 2001
+++ linux-2.4.19/kernel/kmod.c   Fri Aug  2 17:39:46 2002
@@ -24,6 +24,8 @@
 #include <linux/unistd.h>
 #include <linux/kmod.h>
 #include <linux/smp_lock.h>
+#include <linux/slab.h>
+#include <linux/namespace.h>
 #include <linux/completion.h>
 
 #include <asm/uaccess.h>
@@ -36,6 +38,7 @@
    struct fs_struct *our_fs, *init_fs;
    struct dentry *root, *pwd;
    struct vfsmount *rootmnt, *pwdmnt;
+   struct namespace *our_ns, *init_ns;
 
    /*
     * Make modprobe's fs context be a copy of init's.
@@ -55,6 +58,11 @@
     */
 
    init_fs = init_task.fs;
+   init_ns = init_task.namespace;
+   get_namespace(init_ns);
+   our_ns = current->namespace;
+   current->namespace = init_ns;
+   put_namespace(our_ns);
    read_lock(&init_fs->lock);
    rootmnt = mntget(init_fs->rootmnt);
    root = dget(init_fs->root);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.