proc: Implement /proc/thread-self to point at the directory of the current thread
[firefly-linux-kernel-4.4.55.git] / fs / proc / root.c
index 5dbadecb234da01be9cc7eb5705e71363da7dfea..48f1c03bc7ed12cc567ec46f5289d4804c9d684d 100644 (file)
@@ -149,6 +149,8 @@ static void proc_kill_sb(struct super_block *sb)
        ns = (struct pid_namespace *)sb->s_fs_info;
        if (ns->proc_self)
                dput(ns->proc_self);
+       if (ns->proc_thread_self)
+               dput(ns->proc_thread_self);
        kill_anon_super(sb);
        put_pid_ns(ns);
 }
@@ -170,6 +172,7 @@ void __init proc_root_init(void)
                return;
 
        proc_self_init();
+       proc_thread_self_init();
        proc_symlink("mounts", NULL, "self/mounts");
 
        proc_net_init();