Re: [RFC][v3][PATCH 4/7] Add target_pids parameter to alloc_pid()

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

 



Sukadev Bhattiprolu [sukadev@xxxxxxxxxxxxxxxxxx] wrote:
| Amerigo Wang [xiyou.wangcong@xxxxxxxxx] wrote:
| | >@@ -294,7 +295,11 @@ struct pid *alloc_pid(struct pid_namespace *ns)
| | > 
| | > 	tmp = ns;
| | > 	for (i = ns->level; i >= 0; i--) {
| | >-		nr = alloc_pidmap(tmp, 0);
| | >+		tpid = 0;
| | 
| | How about initializing 'tpid' to 0 when define it?
| 
| 'tpid' may contain a non-zero value from the previous iteration and
| needs to be reset each time.

Actually, you are right. target_pids does not change, so tpid could
be set to 0 before the loop.

Sukadev
_______________________________________________
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