From 50bf289d3222208d05905bc59f8ed43a2dd224b1 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Mon, 2 Oct 2006 02:17:07 -0700 Subject: [PATCH] --- yaml --- r: 37759 b: refs/heads/master c: f6c7a1f34e92b0b561024ead9fa70623683025e4 h: refs/heads/master i: 37757: 8c04c64ce569579c88c24b34c55bf183f0c46220 37755: 63d1307654b33894f446c9e35cf399ac045d778e 37751: 32e0ffbbab4a10d8b8bb849e5ce89e82c38aca6a 37743: 294389ae0d2256f698897b7a8542b56844a11ef1 37727: 95a289fd485f2ac262e13d73bc0badb7ec939c9d 37695: 1e3cd23a995f85e1e02ca14f83994b5a69399a4c 37631: 072cd78b56cdd11a61e7628950f79c201556b364 v: v3 --- [refs] | 2 +- trunk/fs/proc/root.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6b34a75adae4..4d865a574be7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 20cdc894c45d2e4ab0c69e95a56b7c5ed36ae0dd +refs/heads/master: f6c7a1f34e92b0b561024ead9fa70623683025e4 diff --git a/trunk/fs/proc/root.c b/trunk/fs/proc/root.c index 8901c65caca8..ffe66c38488b 100644 --- a/trunk/fs/proc/root.c +++ b/trunk/fs/proc/root.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "internal.h" @@ -28,6 +29,17 @@ struct proc_dir_entry *proc_sys_root; static int proc_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) { + if (proc_mnt) { + /* Seed the root directory with a pid so it doesn't need + * to be special in base.c. I would do this earlier but + * the only task alive when /proc is mounted the first time + * is the init_task and it doesn't have any pids. + */ + struct proc_inode *ei; + ei = PROC_I(proc_mnt->mnt_sb->s_root->d_inode); + if (!ei->pid) + ei->pid = find_get_pid(1); + } return get_sb_single(fs_type, flags, data, proc_fill_super, mnt); }