Re: [PATCH v2] fork: fix oops after fork failure

2012-08-25 Thread Glauber Costa
On 08/24/2012 06:08 PM, Andrew Morton wrote: > On Thu, 23 Aug 2012 19:36:08 +0400 > Glauber Costa wrote: > >> When we want to duplicate a new process, dup_task_struct() will undergo >> a series of allocations. If alloc_thread_info_node() fails, we call >> free_task_struct() and return. >> >> This

Re: [PATCH v2] fork: fix oops after fork failure

2012-08-24 Thread Andrew Morton
On Thu, 23 Aug 2012 19:36:08 +0400 Glauber Costa wrote: > When we want to duplicate a new process, dup_task_struct() will undergo > a series of allocations. If alloc_thread_info_node() fails, we call > free_task_struct() and return. > > This seems right, but it is not. free_task_struct() will no

Re: [PATCH v2] fork: fix oops after fork failure

2012-08-23 Thread Frederic Weisbecker
On Thu, Aug 23, 2012 at 07:36:08PM +0400, Glauber Costa wrote: > When we want to duplicate a new process, dup_task_struct() will undergo > a series of allocations. If alloc_thread_info_node() fails, we call > free_task_struct() and return. > > This seems right, but it is not. free_task_struct() wi

[PATCH v2] fork: fix oops after fork failure

2012-08-23 Thread Glauber Costa
When we want to duplicate a new process, dup_task_struct() will undergo a series of allocations. If alloc_thread_info_node() fails, we call free_task_struct() and return. This seems right, but it is not. free_task_struct() will not only free the task struct from the kmem_cache, but will also call