Kill unsharing fs_struct in __set_personality()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 30 Mar 2009 09:45:36 +0000 (05:45 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 1 Apr 2009 03:00:25 +0000 (23:00 -0400)
That's a rudiment of altroot support.  I.e. it should've been buried
a long time ago.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
kernel/exec_domain.c

index 667c841..cb8e962 100644 (file)
@@ -145,28 +145,6 @@ __set_personality(u_long personality)
                return 0;
        }
 
-       if (atomic_read(&current->fs->count) != 1) {
-               struct fs_struct *fsp, *ofsp;
-
-               fsp = copy_fs_struct(current->fs);
-               if (fsp == NULL) {
-                       module_put(ep->module);
-                       return -ENOMEM;
-               }
-
-               task_lock(current);
-               ofsp = current->fs;
-               current->fs = fsp;
-               task_unlock(current);
-
-               put_fs_struct(ofsp);
-       }
-
-       /*
-        * At that point we are guaranteed to be the sole owner of
-        * current->fs.
-        */
-
        current->personality = personality;
        oep = current_thread_info()->exec_domain;
        current_thread_info()->exec_domain = ep;