patch-2.1.90 linux/fs/proc/inode.c

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

diff -u --recursive --new-file v2.1.89/linux/fs/proc/inode.c linux/fs/proc/inode.c
@@ -260,7 +260,13 @@
 	inode->i_size = 0;
 	pid = ino >> 16;
 
-	if (!pid || ((p = find_task_by_pid(pid)) == NULL))
+	if (!pid)
+		return;
+	read_lock(&tasklist_lock);
+	p = find_task_by_pid(pid);
+	read_unlock(&tasklist_lock);	/* FIXME!! This should be done only after we have stopped using 'p' */
+
+	if (!p)
 		return;
 
 	ino &= 0x0000ffff;

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