[criu] 1M guard page ruined restore

2017-06-20 Thread Cyrill Gorcunov
Hi Hugh! We're running our tests on latest vanilla kernel all the time, and recently we've got an issue on restore: https://github.com/xemul/criu/issues/322 | (00.410614) 4: cg: Cgroups 1 inherited from parent | (00.410858) 4: Opened local page read 3 (parent 0) | (00.410961)

Re: [PATCH] aio: Add command to wait completion of all requests

2017-06-13 Thread Cyrill Gorcunov
On Tue, Jun 13, 2017 at 12:45:39PM +0300, Kirill Tkhai wrote: > > > > I'm not that familiar with AIO internals but this snippet worries me: > > the reqs_available is unsigned int, reqs is unsigned it as well but > > used as an accumulator over ALL cpus, can't it get overflow and > > gives modulo

Re: [PATCH] aio: Add command to wait completion of all requests

2017-06-13 Thread Cyrill Gorcunov
On Tue, Jun 13, 2017 at 12:45:39PM +0300, Kirill Tkhai wrote: > > > > I'm not that familiar with AIO internals but this snippet worries me: > > the reqs_available is unsigned int, reqs is unsigned it as well but > > used as an accumulator over ALL cpus, can't it get overflow and > > gives modulo

Re: [PATCH] aio: Add command to wait completion of all requests

2017-06-13 Thread Cyrill Gorcunov
On Fri, Jun 09, 2017 at 12:49:34PM +0300, Kirill Tkhai wrote: ... > +static int aio_wait_all(struct kioctx *ctx) > +{ > + unsigned users, reqs = 0; > + struct kioctx_cpu *kcpu; > + int cpu, ret; > + > + if (atomic_xchg(>dead, 1)) > + return -EBUSY; > + > + users =

Re: [PATCH] aio: Add command to wait completion of all requests

2017-06-13 Thread Cyrill Gorcunov
On Fri, Jun 09, 2017 at 12:49:34PM +0300, Kirill Tkhai wrote: ... > +static int aio_wait_all(struct kioctx *ctx) > +{ > + unsigned users, reqs = 0; > + struct kioctx_cpu *kcpu; > + int cpu, ret; > + > + if (atomic_xchg(>dead, 1)) > + return -EBUSY; > + > + users =

[PATCH linux-next] kcmp: fs/epoll -- Wrap kcmp code with CONFIG_CHECKPOINT_RESTORE

2017-05-13 Thread Cyrill Gorcunov
kcmp syscall is build iif CONFIG_CHECKPOINT_RESTORE is selected, so wrap appropriate helpers in epoll code with the config to build it conditionally. Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> Reported-by: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...

[PATCH linux-next] kcmp: fs/epoll -- Wrap kcmp code with CONFIG_CHECKPOINT_RESTORE

2017-05-13 Thread Cyrill Gorcunov
kcmp syscall is build iif CONFIG_CHECKPOINT_RESTORE is selected, so wrap appropriate helpers in epoll code with the config to build it conditionally. Signed-off-by: Cyrill Gorcunov Reported-by: Andrew Morton CC: Andrey Vagin CC: Al Viro CC: Pavel Emelyanov CC: Michael Kerrisk CC: Jason

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-13 Thread Cyrill Gorcunov
On Sat, May 13, 2017 at 09:55:14AM +0300, Cyrill Gorcunov wrote: > On Fri, May 12, 2017 at 06:45:09PM -0700, Andrei Vagin wrote: > > On Sat, May 13, 2017 at 01:53:40AM +0300, Cyrill Gorcunov wrote: > > > On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > > >

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-13 Thread Cyrill Gorcunov
On Sat, May 13, 2017 at 09:55:14AM +0300, Cyrill Gorcunov wrote: > On Fri, May 12, 2017 at 06:45:09PM -0700, Andrei Vagin wrote: > > On Sat, May 13, 2017 at 01:53:40AM +0300, Cyrill Gorcunov wrote: > > > On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > > >

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-13 Thread Cyrill Gorcunov
On Fri, May 12, 2017 at 06:45:09PM -0700, Andrei Vagin wrote: > On Sat, May 13, 2017 at 01:53:40AM +0300, Cyrill Gorcunov wrote: > > On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > > > [resending as plaintext] > > > > > > I realize that the e

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-13 Thread Cyrill Gorcunov
On Fri, May 12, 2017 at 06:45:09PM -0700, Andrei Vagin wrote: > On Sat, May 13, 2017 at 01:53:40AM +0300, Cyrill Gorcunov wrote: > > On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > > > [resending as plaintext] > > > > > > I realize that the e

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-12 Thread Cyrill Gorcunov
On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > [resending as plaintext] > > I realize that the existing kcmp code has the same issue, but: > > Why are you not taking a reference to filp or filp_tgt? This can end up > performing a comparison between a pointer to a freed struct file

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-12 Thread Cyrill Gorcunov
On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote: > [resending as plaintext] > > I realize that the existing kcmp code has the same issue, but: > > Why are you not taking a reference to filp or filp_tgt? This can end up > performing a comparison between a pointer to a freed struct file

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-12 Thread Cyrill Gorcunov
On Fri, May 12, 2017 at 03:00:18PM -0700, Andrew Morton wrote: > On Mon, 24 Apr 2017 18:39:28 +0300 Cyrill Gorcunov <gorcu...@gmail.com> wrote: > > That's quite a bit more code. Is there a neat way of making it depend > on a new CONFIG_foo, then select CONFIG_foo if > CONF

Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-05-12 Thread Cyrill Gorcunov
On Fri, May 12, 2017 at 03:00:18PM -0700, Andrew Morton wrote: > On Mon, 24 Apr 2017 18:39:28 +0300 Cyrill Gorcunov wrote: > > That's quite a bit more code. Is there a neat way of making it depend > on a new CONFIG_foo, then select CONFIG_foo if > CONFIG_CHECKPOINT_RESTORE?

Re: [PATCH] prctl: Allow local CAP_SYS_ADMIN changing exe_file

2017-05-12 Thread Cyrill Gorcunov
Tkhai <ktk...@virtuozzo.com> > CC: Andrew Morton <a...@linux-foundation.org> > CC: Serge Hallyn <se...@hallyn.com> > CC: "Eric W. Biederman" <ebied...@xmission.com> > CC: Oleg Nesterov <o...@redhat.com> > CC: Michal Hocko <mho...@suse.co

Re: [PATCH] prctl: Allow local CAP_SYS_ADMIN changing exe_file

2017-05-12 Thread Cyrill Gorcunov
ll Tkhai > CC: Andrew Morton > CC: Serge Hallyn > CC: "Eric W. Biederman" > CC: Oleg Nesterov > CC: Michal Hocko > CC: Andrei Vagin > CC: Cyrill Gorcunov > CC: Stanislav Kinsburskiy > CC: Pavel Tikhomirov > --- > kernel/sys.c |8 ++-- > 1 file changed, 2 insertions(+), 6 deletions(-) Reviewed-by: Cyrill Gorcunov

Re: [RFC] tty: pty -- Add ability to setup next pty number for ptmx open

2017-04-27 Thread Cyrill Gorcunov
On Fri, Mar 17, 2017 at 1:56 PM, Cyrill Gorcunov <gorcu...@gmail.com> wrote: > When we restore PTY terminals we do iterate over open() calls to reach > the index used at checkpoint time (say application opened a number of > terminals, then closed all other except last one) which

Re: [RFC] tty: pty -- Add ability to setup next pty number for ptmx open

2017-04-27 Thread Cyrill Gorcunov
On Fri, Mar 17, 2017 at 1:56 PM, Cyrill Gorcunov wrote: > When we restore PTY terminals we do iterate over open() calls to reach > the index used at checkpoint time (say application opened a number of > terminals, then closed all other except last one) which of course very >

Re: [PATCH 2/2] pid_ns: Introduce ioctl to set vector of ns_last_pid's on ns hierarhy

2017-04-24 Thread Cyrill Gorcunov
> One note about struct pidns_ioc_req. It's made extensible and > may expanded in the future. The always existing fields present > at the moment, the future fields and they sizes may be determined > by pidns_ioc_req::req by the future code. > > Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> Reviewed-by: Cyrill Gorcunov <gorcu...@openvz.org>

Re: [PATCH 2/2] pid_ns: Introduce ioctl to set vector of ns_last_pid's on ns hierarhy

2017-04-24 Thread Cyrill Gorcunov
q. It's made extensible and > may expanded in the future. The always existing fields present > at the moment, the future fields and they sizes may be determined > by pidns_ioc_req::req by the future code. > > Signed-off-by: Kirill Tkhai Reviewed-by: Cyrill Gorcunov

[patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-04-24 Thread Cyrill Gorcunov
less if()s in kcmp_epoll_target for readability sake (by avagin@) - Use u32 for kcmp_epoll_slot::toff instead of u64, which makes the less memory pressue Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> Acked-by: Andrey Vagin <ava...@openvz.org> CC: Al Viro <v...@zeniv.linux.org

[patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-04-24 Thread Cyrill Gorcunov
less if()s in kcmp_epoll_target for readability sake (by avagin@) - Use u32 for kcmp_epoll_slot::toff instead of u64, which makes the less memory pressue Signed-off-by: Cyrill Gorcunov Acked-by: Andrey Vagin CC: Al Viro CC: Andrew Morton CC: Pavel Emelyanov CC: Michael Kerrisk CC: Jason

[patch v4 resend 1/2] procfs: fdinfo -- Extend information about epoll target files

2017-04-24 Thread Cyrill Gorcunov
out an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov

[patch v4 resend 1/2] procfs: fdinfo -- Extend information about epoll target files

2017-04-24 Thread Cyrill Gorcunov
out an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Jason Baron CC: Andy Lutomirski --- Documentation/filesystems/proc.txt |6 +- fs

[patch v4 resend 0/2] Extend kcmp for epoll sake

2017-04-24 Thread Cyrill Gorcunov
Hi! Take a look please on the series, should be fine by now. The man page I've been sedning previously is not changed anyhow so to not spam I don't send it again. If needed I'll post it separately. Cyrill

[patch v4 resend 0/2] Extend kcmp for epoll sake

2017-04-24 Thread Cyrill Gorcunov
Hi! Take a look please on the series, should be fine by now. The man page I've been sedning previously is not changed anyhow so to not spam I don't send it again. If needed I'll post it separately. Cyrill

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 12:31:51PM -0700, Andy Lutomirski wrote: ... > > I guess the question comes from that we're releasing CRIU 3.0 with > > 32-bit C/R and some other cool stuff, but we don't support x32 yet. > > As we don't want release a thing that we aren't properly testing. > > So for a

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 12:31:51PM -0700, Andy Lutomirski wrote: ... > > I guess the question comes from that we're releasing CRIU 3.0 with > > 32-bit C/R and some other cool stuff, but we don't support x32 yet. > > As we don't want release a thing that we aren't properly testing. > > So for a

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 10:19:01PM +0300, Dmitry Safonov wrote: > > > > indeed, thanks! > > Also, even more simple-minded: for now we could just check binary magic > from /proc/.../exe, for now stopping on x32 binaries. File may not exist and elfheader wiped out as well.

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 10:19:01PM +0300, Dmitry Safonov wrote: > > > > indeed, thanks! > > Also, even more simple-minded: for now we could just check binary magic > from /proc/.../exe, for now stopping on x32 binaries. File may not exist and elfheader wiped out as well.

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 11:51:09AM -0700, h...@zytor.com wrote: > > > >indeed, thanks! > > I proposed to the ptrace people a virtual register for this and a few other > things, but it got bikeshed to death. Any mail reference left? Would like to read it.

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 11:51:09AM -0700, h...@zytor.com wrote: > > > >indeed, thanks! > > I proposed to the ptrace people a virtual register for this and a few other > things, but it got bikeshed to death. Any mail reference left? Would like to read it.

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 09:09:40PM +0300, Dmitry Safonov wrote: > > I guess the question comes from that we're releasing CRIU 3.0 with > 32-bit C/R and some other cool stuff, but we don't support x32 yet. > As we don't want release a thing that we aren't properly testing. > So for a while we

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 09:09:40PM +0300, Dmitry Safonov wrote: > > I guess the question comes from that we're releasing CRIU 3.0 with > 32-bit C/R and some other cool stuff, but we don't support x32 yet. > As we don't want release a thing that we aren't properly testing. > So for a while we

[Q] Figuring out task mode

2017-03-21 Thread Cyrill Gorcunov
/I renamed the mail's subject/ On Tue, Mar 21, 2017 at 10:45:57AM -0700, Andy Lutomirski wrote: > >> + task_pt_regs(current)->orig_ax |= __X32_SYSCALL_BIT; > >> current->thread.status &= ~TS_COMPAT; > > > > Hi! I must admit I didn't follow close the overall series (so

[Q] Figuring out task mode

2017-03-21 Thread Cyrill Gorcunov
/I renamed the mail's subject/ On Tue, Mar 21, 2017 at 10:45:57AM -0700, Andy Lutomirski wrote: > >> + task_pt_regs(current)->orig_ax |= __X32_SYSCALL_BIT; > >> current->thread.status &= ~TS_COMPAT; > > > > Hi! I must admit I didn't follow close the overall series (so

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 07:37:12PM +0300, Dmitry Safonov wrote: ... > diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c > index d6b784a5520d..d3d4d9abcaf8 100644 > --- a/arch/x86/kernel/process_64.c > +++ b/arch/x86/kernel/process_64.c > @@ -519,8 +519,14 @@ void

Re: [PATCHv2] x86/mm: set x32 syscall bit in SET_PERSONALITY()

2017-03-21 Thread Cyrill Gorcunov
On Tue, Mar 21, 2017 at 07:37:12PM +0300, Dmitry Safonov wrote: ... > diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c > index d6b784a5520d..d3d4d9abcaf8 100644 > --- a/arch/x86/kernel/process_64.c > +++ b/arch/x86/kernel/process_64.c > @@ -519,8 +519,14 @@ void

[RFC] tty: pty -- Add ability to setup next pty number for ptmx open

2017-03-17 Thread Cyrill Gorcunov
ter Anvin" <h...@zytor.com> CC: Andrew Morton <a...@linuxfoundation.org> Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> --- drivers/tty/pty.c | 14 ++ fs/devpts/inode.c | 22 -- include/linux/devpts_fs.h |

[RFC] tty: pty -- Add ability to setup next pty number for ptmx open

2017-03-17 Thread Cyrill Gorcunov
number requested. CC: Andrey Vagin CC: Pavel Emelyanov CC: "Eric W. Biederman" CC: Greg Kroah-Hartman CC: Jiri Slaby CC: "H. Peter Anvin" CC: Andrew Morton Signed-off-by: Cyrill Gorcunov --- drivers/tty/pty.c | 14 ++ fs/devpts/inode.c

Re: [patch 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-03-17 Thread Cyrill Gorcunov
On Thu, Mar 16, 2017 at 09:59:09PM -0700, Andrei Vagin wrote: > On Fri, Mar 10, 2017 at 11:16:56AM +0300, Cyrill Gorcunov wrote: > > Since it is possbile to have same number in tfd field (say > > file added, closed, then nother file dup'ed to same number > > and added

Re: [patch 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-03-17 Thread Cyrill Gorcunov
On Thu, Mar 16, 2017 at 09:59:09PM -0700, Andrei Vagin wrote: > On Fri, Mar 10, 2017 at 11:16:56AM +0300, Cyrill Gorcunov wrote: > > Since it is possbile to have same number in tfd field (say > > file added, closed, then nother file dup'ed to same number > > and added

Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-13 Thread Cyrill Gorcunov
On Mon, Mar 13, 2017 at 10:37:24AM -0700, Andrei Vagin wrote: > > Here is one question inline. > > Acked-by: Andrei Vagin Thanks! > > + > > + files = get_files_struct(task2); > > + if (!files) > > + return -EBADF; > > + > > + spin_lock(>file_lock); > > +

Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-13 Thread Cyrill Gorcunov
On Mon, Mar 13, 2017 at 10:37:24AM -0700, Andrei Vagin wrote: > > Here is one question inline. > > Acked-by: Andrei Vagin Thanks! > > + > > + files = get_files_struct(task2); > > + if (!files) > > + return -EBADF; > > + > > + spin_lock(>file_lock); > > + filp_epoll =

Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-13 Thread Cyrill Gorcunov
On Fri, Mar 10, 2017 at 11:16:57AM +0300, Cyrill Gorcunov wrote: > With current epoll architecture target files are addressed > with file_struct and file descriptor number, where the last > is not unique. Moreover files can be transferred from another > process via unix socket, adde

Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-13 Thread Cyrill Gorcunov
On Fri, Mar 10, 2017 at 11:16:57AM +0300, Cyrill Gorcunov wrote: > With current epoll architecture target files are addressed > with file_struct and file descriptor number, where the last > is not unique. Moreover files can be transferred from another > process via unix socket, adde

[patch 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-03-10 Thread Cyrill Gorcunov
out an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov

[patch 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-03-10 Thread Cyrill Gorcunov
out an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Kir Kolyshkin CC: Jason Baron CC: Andy Lutomirski --- Documentation/filesystems/proc.txt

[patch 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-03-10 Thread Cyrill Gorcunov
Hi! This is slightly updated series for epoll extension in procfs and kcmp syscall. The procfs patch and manpage is unchanged while kcmp syscall is slightly updated to drop hard to read if()'s and shrink memory pressue with kcmp_epoll_slot argument. Please take a look, once time permit. Being

[patch 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-03-10 Thread Cyrill Gorcunov
Hi! This is slightly updated series for epoll extension in procfs and kcmp syscall. The procfs patch and manpage is unchanged while kcmp syscall is slightly updated to drop hard to read if()'s and shrink memory pressue with kcmp_epoll_slot argument. Please take a look, once time permit. Being

[patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-10 Thread Cyrill Gorcunov
less if()s in kcmp_epoll_target for readability sake (by avagin@) - Use u32 for kcmp_epoll_slot::toff instead of u64, which makes the less memory pressue Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfou

[patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-10 Thread Cyrill Gorcunov
less if()s in kcmp_epoll_target for readability sake (by avagin@) - Use u32 for kcmp_epoll_slot::toff instead of u64, which makes the less memory pressue Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Kir Kolyshkin

Re: [RFC v2 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-02 Thread Cyrill Gorcunov
On Wed, Mar 01, 2017 at 03:05:09PM -0800, Andrei Vagin wrote: > > I rewrote this function and I think it looks more readable now. What do you > think? > Agreed! I'll prepare new version for the whole set and resend. Thank you!

Re: [RFC v2 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-03-02 Thread Cyrill Gorcunov
On Wed, Mar 01, 2017 at 03:05:09PM -0800, Andrei Vagin wrote: > > I rewrote this function and I think it looks more readable now. What do you > think? > Agreed! I'll prepare new version for the whole set and resend. Thank you!

Re: [RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-28 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 11:54:34PM +0300, Cyrill Gorcunov wrote: > > I think it should be ebough (together with sdev and pos). But will > look more closely tomorrow once I sit implementing criu support :) > (that's why it is early rfc, to gather comments) FWIW, yes, it is enough

Re: [RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-28 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 11:54:34PM +0300, Cyrill Gorcunov wrote: > > I think it should be ebough (together with sdev and pos). But will > look more closely tomorrow once I sit implementing criu support :) > (that's why it is early rfc, to gather comments) FWIW, yes, it is enough

[RFC v2 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-28 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov <xe...@virtuozzo.com> CC: Michael Kerrisk <mtk.manpa...@gmail.com> CC

[RFC v2 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-28 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Kir Kolyshkin CC: Jason Baron CC: Andy Lutomirski --- fs/eventpoll.c| 42 + include/linux/eventpoll.h |3 ++ include

Re: [RFC 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-27 Thread Cyrill Gorcunov
On Mon, Feb 27, 2017 at 02:43:47PM -0800, Andrei Vagin wrote: ... > > + > > + if (filp1 && filp_epoll) { > > + filp_tgt = get_epoll_tfile_raw_ptr(filp_epoll, > > slot.tfd, slot.toff); > > + if (IS_ERR(filp_tgt)) > > + ret =

Re: [RFC 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-27 Thread Cyrill Gorcunov
On Mon, Feb 27, 2017 at 02:43:47PM -0800, Andrei Vagin wrote: ... > > + > > + if (filp1 && filp_epoll) { > > + filp_tgt = get_epoll_tfile_raw_ptr(filp_epoll, > > slot.tfd, slot.toff); > > + if (IS_ERR(filp_tgt)) > > + ret =

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-22 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 11:29:23AM +0300, Pavel Emelyanov wrote: > On 02/22/2017 11:18 AM, Cyrill Gorcunov wrote: > > On Wed, Feb 22, 2017 at 11:09:23AM +0300, Pavel Emelyanov wrote: > >>>> > >>>> Actually it shouldn't. If you extend the kcmp argument to a

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-22 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 11:29:23AM +0300, Pavel Emelyanov wrote: > On 02/22/2017 11:18 AM, Cyrill Gorcunov wrote: > > On Wed, Feb 22, 2017 at 11:09:23AM +0300, Pavel Emelyanov wrote: > >>>> > >>>> Actually it shouldn't. If you extend the kcmp argument to a

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-22 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 11:09:23AM +0300, Pavel Emelyanov wrote: > >> > >> Actually it shouldn't. If you extend the kcmp argument to accept the > >> epollfd:epollslot pair, this would be effectively the same as if you > >> had all your epoll-ed files injected into your fdtable with "strange" > >>

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-22 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 11:09:23AM +0300, Pavel Emelyanov wrote: > >> > >> Actually it shouldn't. If you extend the kcmp argument to accept the > >> epollfd:epollslot pair, this would be effectively the same as if you > >> had all your epoll-ed files injected into your fdtable with "strange" > >>

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 10:44:07AM +0300, Pavel Emelyanov wrote: > On 02/21/2017 10:16 PM, Cyrill Gorcunov wrote: > > On Tue, Feb 21, 2017 at 10:41:12AM -0800, Andy Lutomirski wrote: > >>> Thus lets add file position, inode and device number where > >>> this t

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
On Wed, Feb 22, 2017 at 10:44:07AM +0300, Pavel Emelyanov wrote: > On 02/21/2017 10:16 PM, Cyrill Gorcunov wrote: > > On Tue, Feb 21, 2017 at 10:41:12AM -0800, Andy Lutomirski wrote: > >>> Thus lets add file position, inode and device number where > >>> this t

Re: [RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-21 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 03:32:21PM -0500, Jason Baron wrote: > Hi, > > Since an epoll fd can be added to another epoll fd, I'm wondering if you > have enough data here to figure that out. The inode is the > 'anon_inode_inode', so I'm wondering if that is sufficient to distinguish it > from other

Re: [RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-21 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 03:32:21PM -0500, Jason Baron wrote: > Hi, > > Since an epoll fd can be added to another epoll fd, I'm wondering if you > have enough data here to figure that out. The inode is the > 'anon_inode_inode', so I'm wondering if that is sufficient to distinguish it > from other

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 10:41:12AM -0800, Andy Lutomirski wrote: > > Thus lets add file position, inode and device number where > > this target lays. This three fields can be used as a primary > > key for sorting, and together with kcmp help CRIU can find > > out an exact file target (from the

Re: [RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
On Tue, Feb 21, 2017 at 10:41:12AM -0800, Andy Lutomirski wrote: > > Thus lets add file position, inode and device number where > > this target lays. This three fields can be used as a primary > > key for sorting, and together with kcmp help CRIU can find > > out an exact file target (from the

[RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-21 Thread Cyrill Gorcunov
Hi! In previous series EPOLL_CTL_DUP operation has been discussed but considered as potentially scary. So here is an another approach: - extend fdinfo of epoll files with inode, device and file position for every target, which allow the reader to gather targets with this bundle as a key

[RFC 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-21 Thread Cyrill Gorcunov
0,1,2 result for sorting purpose Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov <xe...@virtuozzo.com> CC: Michael K

[RFC 0/3] fs,epoll: Add ability to call kcmp to find target files

2017-02-21 Thread Cyrill Gorcunov
Hi! In previous series EPOLL_CTL_DUP operation has been discussed but considered as potentially scary. So here is an another approach: - extend fdinfo of epoll files with inode, device and file position for every target, which allow the reader to gather targets with this bundle as a key

[RFC 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

2017-02-21 Thread Cyrill Gorcunov
0,1,2 result for sorting purpose Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Kir Kolyshkin CC: Jason Baron CC: Andy Lutomirski --- fs/eventpoll.c| 42

[RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundation.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov <xe...

[RFC 1/3] procfs: fdinfo -- Extend information about epoll target files

2017-02-21 Thread Cyrill Gorcunov
an exact file target (from the whole set of processes being checkpointed). Signed-off-by: Cyrill Gorcunov CC: Al Viro CC: Andrew Morton CC: Andrey Vagin CC: Pavel Emelyanov CC: Michael Kerrisk CC: Kir Kolyshkin CC: Jason Baron CC: Andy Lutomirski --- Documentation/filesystems/proc.txt |6

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 01:34:04PM -0500, Jason Baron wrote: > > > > kcmp over target set seems to be preferred since it gonna be a way > > faster. But I think about fd-ref idea too. Thanks a huge! > > > > I sort of like kcmp() for this as well maybe the epoll fd argument can be a > pointer to

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 01:34:04PM -0500, Jason Baron wrote: > > > > kcmp over target set seems to be preferred since it gonna be a way > > faster. But I think about fd-ref idea too. Thanks a huge! > > > > I sort of like kcmp() for this as well maybe the epoll fd argument can be a > pointer to

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 09:20:34AM -0800, Andy Lutomirski wrote: > >> > >> This is a scary thing to let an unprivileged process do. > >> > >> I'm wondering if there might be a nicer way to address this using a > >> better interface in /proc. > > > > Well, I tend to agree. Need to add security

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 09:20:34AM -0800, Andy Lutomirski wrote: > >> > >> This is a scary thing to let an unprivileged process do. > >> > >> I'm wondering if there might be a nicer way to address this using a > >> better interface in /proc. > > > > Well, I tend to agree. Need to add security

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 08:52:59AM -0800, Andy Lutomirski wrote: > > > > To resolve this tie lets add EPOLL_CTL_DUP operation which simply takes > > target file descriptor number and installs it into a caller's file table, > > thus we can use kcmp() syscall and figure out which exactly file to be

Re: [RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
On Fri, Feb 17, 2017 at 08:52:59AM -0800, Andy Lutomirski wrote: > > > > To resolve this tie lets add EPOLL_CTL_DUP operation which simply takes > > target file descriptor number and installs it into a caller's file table, > > thus we can use kcmp() syscall and figure out which exactly file to be

[RFC 0/2] fs,eventpoll: Add EPOLL_CTL_DUP into epoll_ctl syscall

2017-02-17 Thread Cyrill Gorcunov
In the series new EPOLL_CTL_DUP operation introduced, we need it to be able to restore target file descriptors in case if they were dup'ed (or received via unix message) before registering and closed after, so the fdinfo info shows file number which application no longer having. Please take a

[RFC 0/2] fs,eventpoll: Add EPOLL_CTL_DUP into epoll_ctl syscall

2017-02-17 Thread Cyrill Gorcunov
In the series new EPOLL_CTL_DUP operation introduced, we need it to be able to restore target file descriptors in case if they were dup'ed (or received via unix message) before registering and closed after, so the fdinfo info shows file number which application no longer having. Please take a

[RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
exactly file to be added into eventpoll on restore procedure. Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov <xe...@virtuozzo.com> CC: Al Viro <v...@zeniv.linux.org.uk> CC: Andrew Morton <a...@linuxfoundati

[RFC 1/2] fs,eventpoll: Add ability to install target file by its number

2017-02-17 Thread Cyrill Gorcunov
exactly file to be added into eventpoll on restore procedure. Signed-off-by: Cyrill Gorcunov CC: Andrey Vagin CC: Pavel Emelyanov CC: Al Viro CC: Andrew Morton CC: Michael Kerrisk CC: Kir Kolyshkin --- fs/eventpoll.c | 74 +++-- include

Re: [RFC] fs,eventpoll: Add ability to install target file by its number

2017-02-15 Thread Cyrill Gorcunov
On Wed, Feb 15, 2017 at 12:29:04PM -0800, Andrew Morton wrote: > On Wed, 15 Feb 2017 19:14:54 +0300 Cyrill Gorcunov <gorcu...@gmail.com> wrote: > > > When we checkpoint a process we look into /proc//fdinfo/ of > > eventpoll > > file and parse target files list

Re: [RFC] fs,eventpoll: Add ability to install target file by its number

2017-02-15 Thread Cyrill Gorcunov
On Wed, Feb 15, 2017 at 12:29:04PM -0800, Andrew Morton wrote: > On Wed, 15 Feb 2017 19:14:54 +0300 Cyrill Gorcunov wrote: > > > When we checkpoint a process we look into /proc//fdinfo/ of > > eventpoll > > file and parse target files list from there. In most situations

[RFC] fs,eventpoll: Add ability to install target file by its number

2017-02-15 Thread Cyrill Gorcunov
we can use kcmp() syscall and figure out which exactly file to be added into eventpoll on restore procedure. Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org> CC: Andrey Vagin <ava...@openvz.org> CC: Pavel Emelyanov <xe...@virtuozzo.com> CC: Al Viro <v...@zeniv.

[RFC] fs,eventpoll: Add ability to install target file by its number

2017-02-15 Thread Cyrill Gorcunov
we can use kcmp() syscall and figure out which exactly file to be added into eventpoll on restore procedure. Signed-off-by: Cyrill Gorcunov CC: Andrey Vagin CC: Pavel Emelyanov CC: Al Viro CC: Andrew Morton --- fs/eventpoll.c | 74 +++-- in

[PATCH] fs,eventpoll: Don't test for bitfield with stack value

2017-02-14 Thread Cyrill Gorcunov
nts has this bit set, still better to be on safe side and make sure that we're to test this bit at all. Signed-off-by: Cyrill Gorcunov <gorcu...@gmail.com> --- fs/eventpoll.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux

[PATCH] fs,eventpoll: Don't test for bitfield with stack value

2017-02-14 Thread Cyrill Gorcunov
nts has this bit set, still better to be on safe side and make sure that we're to test this bit at all. Signed-off-by: Cyrill Gorcunov --- fs/eventpoll.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-ml.gi

Re: [PATCH 1/2] ns: Allow ns_entries to have custom symlink content

2017-01-16 Thread Cyrill Gorcunov
i <ktk...@virtuozzo.com> I don't like much @real_ns_name variable naming, but it's just personal opinion. The rest looks good to me (for both patches). If only I didn't miss something obvious. Reviewed-by: Cyrill Gorcunov <gorcu...@openvz.org>

Re: [PATCH 1/2] ns: Allow ns_entries to have custom symlink content

2017-01-16 Thread Cyrill Gorcunov
l Tkhai I don't like much @real_ns_name variable naming, but it's just personal opinion. The rest looks good to me (for both patches). If only I didn't miss something obvious. Reviewed-by: Cyrill Gorcunov

Re: [PATCH 1/2] kernel: Move prctl and helpers from kernel/sys.c to new kernel/prctl.c

2016-11-08 Thread Cyrill Gorcunov
+ */ > + err = -EPERM; > + if (test_and_set_bit(MMF_EXE_FILE_CHANGED, >flags)) > + goto exit; IIRC this snippet has been dropped in linux-next tree. Stas CC'ed. The rest looks cool for me. Thanks! Reviewed-by: Cyrill Gorcunov <gorcu...@openvz.org>

Re: [PATCH 1/2] kernel: Move prctl and helpers from kernel/sys.c to new kernel/prctl.c

2016-11-08 Thread Cyrill Gorcunov
= -EPERM; > + if (test_and_set_bit(MMF_EXE_FILE_CHANGED, >flags)) > + goto exit; IIRC this snippet has been dropped in linux-next tree. Stas CC'ed. The rest looks cool for me. Thanks! Reviewed-by: Cyrill Gorcunov

Re: [PATCH] net: ip, diag -- Adjust raw_abort to use unlocked __udp_disconnect

2016-11-01 Thread Cyrill Gorcunov
ipv6.org> > > CC: Patrick McHardy <ka...@trash.net> > > CC: Andrey Vagin <ava...@openvz.org> > > CC: Stephen Hemminger <step...@networkplumber.org> > > That is a lot of CC ... Because I CC'ed all for raw diag first patch, so I thought I've to notify

Re: [PATCH] net: ip, diag -- Adjust raw_abort to use unlocked __udp_disconnect

2016-11-01 Thread Cyrill Gorcunov
st patch, so I thought I've to notify them with this typo in code. > > Signed-off-by: Cyrill Gorcunov > > Acked-by: Eric Dumazet > > Thanks. > > Cyrill

[PATCH] net: ip, diag -- Adjust raw_abort to use unlocked __udp_disconnect

2016-11-01 Thread Cyrill Gorcunov
ey Kuznetsov <kuz...@ms2.inr.ac.ru> CC: James Morris <jmor...@namei.org> CC: Hideaki YOSHIFUJI <yoshf...@linux-ipv6.org> CC: Patrick McHardy <ka...@trash.net> CC: Andrey Vagin <ava...@openvz.org> CC: Stephen Hemminger <step...@networkplumber.org> Signed-off-by: C

<    1   2   3   4   5   6   7   8   9   10   >