Re: [RFC PATCH] namespaces: fix leak on fork() failure

From: Eric W. Biederman
Date: Wed May 02 2012 - 13:32:52 EST


Oleg Nesterov <oleg@xxxxxxxxxx> writes:

> On 04/29, Eric W. Biederman wrote:
>>
>> Oleg Nesterov <oleg@xxxxxxxxxx> writes:
>>
>> > On 04/29, Eric W. Biederman wrote:
>> >>
>> >> There are crazy code paths like daemonize()
>> >
>> > Forget. It has no callers anymore, should be killed. A user-space process
>> > should never use kernel_thread() and thus daemonize() is not needed.
>>
>> Good point. Oleg do you think you can send in the patches to kill
>> daemonize.
>
> Yes, will do. I am waiting until the last user in arch/powerpc goes
> away, the patch is already in mm.

Well I don't quite know what the path was but it looks like that change
has already hit Linus's tree:


commit 37ef9bd48af6ab9a3d1fd28df4f929abc19f2cc3
Author: Oleg Nesterov <oleg@xxxxxxxxxx>
Date: Wed Mar 28 12:20:57 2012 +0000

powerpc/eeh: Remove eeh_event_handler()->daemonize()

daemonize() is only needed when a user-space task does kernel_thread().

eeh_event_handler() thread is created by the worker kthread, and thus it
doesn't need the soon-to-be-deprecated daemonize().

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Acked-by: Linas Vepstas <linasvepstas@xxxxxxxxx>
Acked-by: Tejun Heo <tj@xxxxxxxxxx>
Acked-by: Matt Fleming <matt.fleming@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>

diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index 4a47525..92dd84c 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -59,7 +59,7 @@ static int eeh_event_handler(void * dummy)
struct eeh_event *event;
struct eeh_dev *edev;

- daemonize("eehd");
+ set_task_comm(current, "eehd");
set_current_state(TASK_INTERRUPTIBLE);

spin_lock_irqsave(&eeh_eventlist_lock, flags);


Eric
--
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/