patch-2.1.58 linux/fs/proc/base.c

Next file: linux/fs/proc/generic.c
Previous file: linux/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.57/linux/fs/proc/base.c linux/fs/proc/base.c
@@ -50,13 +50,17 @@
 	NULL			/* permission */
 };
 
-static void proc_pid_fill_inode(struct inode * inode)
+/*
+ * The fill argument is non-zero when the inode is being filled ...
+ * we don't need to do anything when it's being deleted.
+ */
+static void proc_pid_fill_inode(struct inode * inode, int fill)
 {
 	struct task_struct *p;
 	int pid = inode->i_ino >> 16;
 	int ino = inode->i_ino & 0xffff;
 
-	if ((p = find_task_by_pid(pid)) != NULL) {
+	if (fill && (p = find_task_by_pid(pid)) != NULL) {
 		if (p->dumpable || ino == PROC_PID_INO) {
 			inode->i_uid = p->euid;
 			inode->i_gid = p->gid;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov