Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-29 Thread Chen Fan
On 09/29/2015 12:37 AM, Eric W. Biederman wrote: Oleg Nesterov writes: On 09/25, Konstantin Khlebnikov wrote: +struct ns_common *proc_ns_fdget(int fd, int nstype, struct fd *fd_ref) { - struct file *file; + struct ns_common *ns; + struct fd f; - file = fget(fd); -

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-29 Thread Eric W. Biederman
Oleg Nesterov writes: > On 09/29, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > OK, I won't insist, this too looks better to me than >> > proc_ns_fdget(&fd_ref). >> > >> > And in any case fcheck_files() makes more sense than fdget(), somehow I did >> > not think about this when I

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-29 Thread Oleg Nesterov
On 09/29, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > OK, I won't insist, this too looks better to me than proc_ns_fdget(&fd_ref). > > > > And in any case fcheck_files() makes more sense than fdget(), somehow I did > > not think about this when I sent 1/1. > > > > Hmm. and after the q

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-29 Thread Eric W. Biederman
Oleg Nesterov writes: > On 09/28, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > Honestly, I do not really like the new helper... I understand this >> > is subjective, so I won't insist. But how about 1/1? We do not need >> > fd/file at all. With this patch your sys_getvpid() can j

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-29 Thread Oleg Nesterov
On 09/28, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > Honestly, I do not really like the new helper... I understand this > > is subjective, so I won't insist. But how about 1/1? We do not need > > fd/file at all. With this patch your sys_getvpid() can just use > > proc_get_ns_by_fd(fd

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-28 Thread Eric W. Biederman
Oleg Nesterov writes: > On 09/25, Konstantin Khlebnikov wrote: >> >> +struct ns_common *proc_ns_fdget(int fd, int nstype, struct fd *fd_ref) >> { >> -struct file *file; >> +struct ns_common *ns; >> +struct fd f; >> >> -file = fget(fd); >> -if (!file) >> +f = fdget(fd);

Re: [PATCH 0/1] ns: introduce proc_get_ns_by_fd()

2015-09-28 Thread Konstantin Khlebnikov
On 25.09.2015 20:56, Oleg Nesterov wrote: On 09/25, Konstantin Khlebnikov wrote: +struct ns_common *proc_ns_fdget(int fd, int nstype, struct fd *fd_ref) { - struct file *file; + struct ns_common *ns; + struct fd f; - file = fget(fd); - if (!file) + f = fdg