- proc-remove-tasklist_lock-from-proc_pid_readdir-simply-fix-first_tgid.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     simply fix first_tgid

has been removed from the -mm tree.  Its filename is

     proc-remove-tasklist_lock-from-proc_pid_readdir-simply-fix-first_tgid.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: simply fix first_tgid
From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>


Like the bug Oleg spotted in first_tid there was also a small off by one
error in first_tgid, when a seek was done on the /proc directory.  This
fixes that and changes the code structure to make it a little more obvious
what is going on.

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/proc/base.c |   28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff -puN fs/proc/base.c~proc-remove-tasklist_lock-from-proc_pid_readdir-simply-fix-first_tgid fs/proc/base.c
--- a/fs/proc/base.c~proc-remove-tasklist_lock-from-proc_pid_readdir-simply-fix-first_tgid
+++ a/fs/proc/base.c
@@ -2040,34 +2040,32 @@ out:
  * In the case of a seek we start with &init_task and walk nr
  * threads past it.
  */
-static struct task_struct *first_tgid(int tgid, int nr)
+static struct task_struct *first_tgid(int tgid, unsigned int nr)
 {
-	struct task_struct *pos = NULL;
+	struct task_struct *pos;
 	rcu_read_lock();
 	if (tgid && nr) {
 		pos = find_task_by_pid(tgid);
-		if (pos && !thread_group_leader(pos))
-			pos = NULL;
-		if (pos)
-			nr = 0;
+		if (pos && thread_group_leader(pos))
+			goto found;
 	}
 	/* If nr exceeds the number of processes get out quickly */
+	pos = NULL;
 	if (nr && nr >= nr_processes())
 		goto done;
 
 	/* If we haven't found our starting place yet start with
 	 * the init_task and walk nr tasks forward.
 	 */
-	if (!pos && (nr >= 0))
-		pos = next_task(&init_task);
-
-	for (; pos && pid_alive(pos); pos = next_task(pos)) {
-		if (--nr > 0)
-			continue;
-		get_task_struct(pos);
-		goto done;
+	for (pos = next_task(&init_task); nr > 0; --nr) {
+		pos = next_task(pos);
+		if (pos == &init_task) {
+			pos = NULL;
+			goto done;
+		}
 	}
-	pos = NULL;
+found:
+	get_task_struct(pos);
 done:
 	rcu_read_unlock();
 	return pos;
_

Patches currently in -mm which might be from ebiederm@xxxxxxxxxxxx are

origin.patch
powerpc-adding-the-use-of-the-firmware-soft-reset-nmi-to-kdump.patch
proc-sysctl-add-_proc_do_string-helper.patch
namespaces-add-nsproxy.patch
namespaces-add-nsproxy-dont-include-compileh.patch
namespaces-incorporate-fs-namespace-into-nsproxy.patch
namespaces-utsname-introduce-temporary-helpers.patch
namespaces-utsname-switch-to-using-uts-namespaces.patch
namespaces-utsname-switch-to-using-uts-namespaces-alpha-fix.patch
namespaces-utsname-switch-to-using-uts-namespaces-cleanup.patch
namespaces-utsname-use-init_utsname-when-appropriate.patch
namespaces-utsname-use-init_utsname-when-appropriate-cifs-update.patch
namespaces-utsname-implement-utsname-namespaces.patch
namespaces-utsname-implement-utsname-namespaces-export.patch
namespaces-utsname-implement-utsname-namespaces-dont-include-compileh.patch
namespaces-utsname-sysctl-hack.patch
namespaces-utsname-sysctl-hack-cleanup.patch
namespaces-utsname-sysctl-hack-cleanup-2.patch
namespaces-utsname-sysctl-hack-cleanup-2-fix.patch
namespaces-utsname-remove-system_utsname.patch
namespaces-utsname-implement-clone_newuts-flag.patch
uts-copy-nsproxy-only-when-needed.patch
ipc-namespace-core-fix.patch
ipc-namespace-core-unshare-fix.patch
ipc-namespace-utils-compilation-fix.patch
genirq-irq-document-what-an-irq-is.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux