Re: [2.4] build error with latest BK [fixed patch]

From: Nuno Monteiro
Date: Wed Jun 16 2004 - 10:09:47 EST


On 2004.06.16 10:04, Nick Piggin wrote:
> Just simply replace put_task_struct with free_task_struct.

Sorry, only sent half of the patch the first time around. Here it is,
with the second hunk touching rwsem-spinlock.c.

This applies on top of what's currently in BK, and fixes the problems for
me -- it is compiled and boot tested, running for the last 20 minutes.
Also, linux/mm.h is needed because of free_pages().

I don't have any arch around here that actually needs rwsem-spinlock.c so
that part is untested, although it should be ok.

Marcelo, please apply.



--- linux-2.4-BK/lib/rwsem.c~fix-rwsem-race-fix 2004-06-16 14:14:02.000000000 +0100
+++ linux-2.4-BK/lib/rwsem.c 2004-06-16 14:14:28.000000000 +0100
@@ -5,6 +5,7 @@
*/
#include <linux/rwsem.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/module.h>

struct rwsem_waiter {
@@ -64,7 +65,7 @@ static inline struct rw_semaphore *__rws
mb();
waiter->task = NULL;
wake_up_process(tsk);
- put_task_struct(tsk);
+ free_task_struct(tsk);
goto out;

/* grant an infinite number of read locks to the readers at the front of the queue
@@ -96,7 +97,7 @@ static inline struct rw_semaphore *__rws
mb();
waiter->task = NULL;
wake_up_process(tsk);
- put_task_struct(tsk);
+ free_task_struct(tsk);
}

sem->wait_list.next = next;
--- linux-2.4-BK/lib/rwsem-spinlock.c~fix-rwsem-race-fix 2004-06-16 15:47:26.982774224 +0100
+++ linux-2.4-BK/lib/rwsem-spinlock.c 2004-06-16 15:51:17.522726824 +0100
@@ -9,6 +9,7 @@
*/
#include <linux/rwsem.h>
#include <linux/sched.h>
+#include <linux/mm.h>
#include <linux/module.h>

struct rwsem_waiter {
@@ -69,7 +70,7 @@ static inline struct rw_semaphore *__rws
mb();
waiter->task = NULL;
wake_up_process(tsk);
- put_task_struct(tsk);
+ free_task_struct(tsk);
goto out;
}

@@ -81,7 +82,7 @@ static inline struct rw_semaphore *__rws
mb();
waiter->task = NULL;
wake_up_process(tsk);
- put_task_struct(tsk);
+ free_task_struct(tsk);
woken++;
if (list_empty(&sem->wait_list))
break;
@@ -111,7 +112,7 @@ static inline struct rw_semaphore *__rws
mb();
waiter->task = NULL;
wake_up_process(tsk);
- put_task_struct(tsk);
+ free_task_struct(tsk);
return sem;
}



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/