]> git.baikalelectronics.ru Git - kernel.git/commit
uprobes: Change the callsite of uprobe_copy_process()
authorOleg Nesterov <oleg@redhat.com>
Sun, 13 Oct 2013 19:18:31 +0000 (21:18 +0200)
committerOleg Nesterov <oleg@redhat.com>
Tue, 29 Oct 2013 17:02:48 +0000 (18:02 +0100)
commit05382640a294b80a9226e3db78d3d47640c933b5
treee6950bc5bafbb845ce1f7650e738e6aac7e12b12
parentaa28aac8d826066436338f94c233c9c8b06c982d
uprobes: Change the callsite of uprobe_copy_process()

Preparation for the next patches.

Move the callsite of uprobe_copy_process() in copy_process() down
to the succesfull return. We do not care if copy_process() fails,
uprobe_free_utask() won't be called in this case so the wrong
->utask != NULL doesn't matter.

OTOH, with this change we know that copy_process() can't fail when
uprobe_copy_process() is called, the new task should either return
to user-mode or call do_exit(). This way uprobe_copy_process() can:

1. setup p->utask != NULL if necessary

2. setup uprobes_state.xol_area

3. use task_work_add(p)

Also, move the definition of uprobe_copy_process() down so that it
can see get_utask().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
kernel/events/uprobes.c
kernel/fork.c