RE: [PATCH] ns: introduce getnspid syscall

2014-06-20 Thread chenhanx...@cn.fujitsu.com
Berrange; Al Viro; > David > Howells; Richard Weinberger; Pavel Emelyanov; Vasiliy Kulikov; Gotou, > Yasunori/ > 五�u 康文 > Subject: Re: [PATCH] ns: introduce getnspid syscall > > On 06/17, Chen Hanxiao wrote: > > > > +SYSCALL_DEFINE4(getnspid, pid_t, pid, int, fd1,

Re: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread Pavel Emelyanov
On 06/18/2014 10:02 PM, Oleg Nesterov wrote: > On 06/17, Pavel Emelyanov wrote: >> >> On 06/17/2014 02:21 PM, Chen Hanxiao wrote: >>> + case PIDTYPE_PID: >>> + ret = task_pid_nr_ns(task, ns2); >> >> But this is not correct. If task doesn't live in ns2, but ns2 >> just has the ns->level

Re: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread Oleg Nesterov
On 06/17, Pavel Emelyanov wrote: > > On 06/17/2014 02:21 PM, Chen Hanxiao wrote: > > + case PIDTYPE_PID: > > + ret = task_pid_nr_ns(task, ns2); > > But this is not correct. If task doesn't live in ns2, but ns2 > just has the ns->level small enough, then the wrong pid value > would be re

Re: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread Oleg Nesterov
On 06/17, Chen Hanxiao wrote: > > +SYSCALL_DEFINE4(getnspid, pid_t, pid, int, fd1, int, fd2, int, pidtype) > +{ > + struct file *file1 = NULL, *file2 = NULL; > + struct task_struct *task; > + struct pid_namespace *ns1, *ns2; > + struct proc_ns *ei; > + int ret = -1; > + > +

RE: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread chenhanx...@cn.fujitsu.com
nge; Oleg Nesterov; Al Viro; David > Howells; Richard Weinberger; Pavel Emelyanov; Vasiliy Kulikov; Gotou, > Yasunori/ > 五�u 康文; Linux API; Michael Kerrisk-manpages > Subject: Re: [PATCH] ns: introduce getnspid syscall > > Chen Hanxiao writes: > > > We need a direc

RE: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread chenhanx...@cn.fujitsu.com
erov; > David Howells; Eric W. Biederman; Andrew Morton; Al Viro; Linux API; Michael > Kerrisk-manpages > Subject: Re: [PATCH] ns: introduce getnspid syscall > > Hello Chen Hanxiao > > On Tue, Jun 17, 2014 at 12:21 PM, Chen Hanxiao > wrote: > > We need a direct metho

RE: [PATCH] ns: introduce getnspid syscall

2014-06-18 Thread chenhanx...@cn.fujitsu.com
P. Berrange; Oleg > Nesterov; > Al Viro; David Howells; Richard Weinberger; Vasiliy Kulikov; Gotou, Yasunori/ > 五�u 康文 > Subject: Re: [PATCH] ns: introduce getnspid syscall > > On 06/17/2014 02:21 PM, Chen Hanxiao wrote: > > We need a direct method of getting the pid insi

Re: [PATCH] ns: introduce getnspid syscall

2014-06-17 Thread Eric W. Biederman
Chen Hanxiao writes: > We need a direct method of getting the pid inside containers. > If some issues occurred inside container guest, host user > could not know which process is in trouble just by guest pid: > the users of container guest only knew the pid inside containers. > This will bring ob

Re: [PATCH] ns: introduce getnspid syscall

2014-06-17 Thread Michael Kerrisk
Hello Chen Hanxiao On Tue, Jun 17, 2014 at 12:21 PM, Chen Hanxiao wrote: > We need a direct method of getting the pid inside containers. > If some issues occurred inside container guest, host user > could not know which process is in trouble just by guest pid: > the users of container guest only

Re: [PATCH] ns: introduce getnspid syscall

2014-06-17 Thread Pavel Emelyanov
On 06/17/2014 02:21 PM, Chen Hanxiao wrote: > We need a direct method of getting the pid inside containers. > If some issues occurred inside container guest, host user > could not know which process is in trouble just by guest pid: > the users of container guest only knew the pid inside containers.