Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[linux-2.6-block.git] / fs / proc / base.c
index 7dc3ea89ef1a7ffd7d8c01939ffa52da392bc2bb..3f3d7aeb071257a15afaa9a65f88642e307f80f3 100644 (file)
@@ -2670,6 +2670,9 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
                dput(dentry);
        }
 
+       if (pid == tgid)
+               return;
+
        name.name = buf;
        name.len = snprintf(buf, sizeof(buf), "%d", tgid);
        leader = d_hash_and_lookup(mnt->mnt_root, &name);
@@ -2841,7 +2844,7 @@ retry:
 int proc_pid_readdir(struct file *file, struct dir_context *ctx)
 {
        struct tgid_iter iter;
-       struct pid_namespace *ns = file->f_dentry->d_sb->s_fs_info;
+       struct pid_namespace *ns = file_inode(file)->i_sb->s_fs_info;
        loff_t pos = ctx->pos;
 
        if (pos >= PID_MAX_LIMIT + TGID_OFFSET)
@@ -3148,7 +3151,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)
        /* f_version caches the tgid value that the last readdir call couldn't
         * return. lseek aka telldir automagically resets f_version to 0.
         */
-       ns = file->f_dentry->d_sb->s_fs_info;
+       ns = inode->i_sb->s_fs_info;
        tid = (int)file->f_version;
        file->f_version = 0;
        for (task = first_tid(proc_pid(inode), tid, ctx->pos - 2, ns);