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

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

diff -u --recursive --new-file v2.1.89/linux/fs/proc/fd.c linux/fs/proc/fd.c
@@ -96,7 +96,9 @@
 			break;
 		}
 	}
+	read_lock(&tasklist_lock);
 	p = find_task_by_pid(pid);
+	read_unlock(&tasklist_lock);	/* FIXME!! This should be done only after not using 'p' any more */
 	if (!pid || !p)
 		return -ENOENT;
 
@@ -149,7 +151,9 @@
 			return 0;
 	}
 
+	read_lock(&tasklist_lock);
 	p = find_task_by_pid(pid);
+	read_unlock(&tasklist_lock);	/* FIXME!! This should be done only after not using 'p' any more */
 	if(!p)
 		return 0;
 	tarrayp = p->tarray_ptr;

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