Re: [RFC v12][PATCH 13/14] Checkpoint multiple processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Nathan Lynch wrote:
>> +/* count number of tasks in tree (and optionally fill pid's in array) */
>> +static int cr_tree_count_tasks(struct cr_ctx *ctx)
>> +{
>> +	struct task_struct *root = ctx->root_task;
>> +	struct task_struct *task = root;
>> +	struct task_struct *parent = NULL;
>> +	struct task_struct **tasks_arr = ctx->tasks_arr;
>> +	int tasks_nr = ctx->tasks_nr;
>> +	int nr = 0;
>> +
>> +	read_lock(&tasklist_lock);
>> +
>> +	/* count tasks via DFS scan of the tree */
>> +	while (1) {
>> +		if (tasks_arr) {
>> +			/* unlikely, but ... */
>> +			if (nr == tasks_nr)
>> +				return -EBUSY;	/* cleanup in cr_ctx_free() */
> 
> Returns without unlocking tasklist_lock?
> 

Thanks. Will fix.

Oren.
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux