Skip to contentSkip to conversation

Fix logic in __ipipe_get_task_info

PATCH Applied Jan Kiszka 2 participants 2 messages May 25, 2007 – May 27, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/2 Fix logic in __ipipe_get_task_info

That was obviously wrong, causing double acquisitions.

Jan

---
 kernel/ipipe/tracer.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
kernel/ipipe/tracer.c +4 -3
Index: linux-2.6.20/kernel/ipipe/tracer.c
===================================================================
@@ -572,9 +572,10 @@ __ipipe_get_task_info(char *task_info, s
 	int i;
 	int locked = 1;
 
-	if (trylock && !read_trylock(&tasklist_lock))
-		locked = 0;
-	else
+	if (trylock) {
+		if (!read_trylock(&tasklist_lock))
+			locked = 0;
+	} else
 		read_lock(&tasklist_lock);
 
 	if (locked)
#1 lore raw
Quoted 2 lines · Jan Kiszka

That was obviously wrong, causing double acquisitions.

Merged, thanks.

Quoted 24 lines

Jan
plain text document attachment (fix-__ipipe_get_task_info.patch)

---
 kernel/ipipe/tracer.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6.20/kernel/ipipe/tracer.c
===================================================================

kernel/ipipe/tracer.c +4 -3
@@ -572,9 +572,10 @@ __ipipe_get_task_info(char *task_info, s
 	int i;
 	int locked = 1;
 
-	if (trylock && !read_trylock(&tasklist_lock))
-		locked = 0;
-	else
+	if (trylock) {
+		if (!read_trylock(&tasklist_lock))
+			locked = 0;
+	} else
 		read_lock(&tasklist_lock);
 
 	if (locked)
Signature · 1 line
Philippe.