Re: [PATCH] nsproxy: remove judge of timens_on_fork()'s return val

2020-11-17 Thread Andrey Vagin
On Sun, Nov 15, 2020 at 10:36 AM Hui Su wrote: > > timens_on_fork() always return 0, and maybe not > need to judge the return value in copy_namespaces(). Thank you for cleaning this up. I think we can go even further and change timens_on_fork to return nothing: -int timens_on_fork(struct nsproxy

Re: [PATCHv7 15/33] posix-timers: Make clock_nanosleep() time namespace aware

2019-10-14 Thread Andrey Vagin
On Sun, Oct 13, 2019 at 9:28 PM kbuild test robot wrote: > > Hi Dmitry, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [cannot apply to v5.4-rc2 next-20191011] > [if your patch is applied to the wrong git tree, please drop us a note to help > i

Re: [RFC 00/20] ns: Introduce Time Namespace

2018-10-01 Thread Andrey Vagin
On Thu, Sep 27, 2018 at 11:41:49PM +0200, Thomas Gleixner wrote: > On Thu, 27 Sep 2018, Thomas Gleixner wrote: > > Add time skew via NTP/PTP into the picture and you might have to adjust > > timers as well, because you need to guarantee that they are not expiring > > early. > > > > I haven't looke

Re: Setting monotonic time?

2018-10-01 Thread Andrey Vagin
On Mon, Oct 01, 2018 at 11:15:32AM +0200, Eric W. Biederman wrote: > > In the context of process migration there is a simpler subproblem that I > think it is worth exploring if we can do something about. > > For a cluster of machines all running with synchronized > clocks. CLOCK_REALTIME matches.

Re: [RFC 00/20] ns: Introduce Time Namespace

2018-09-24 Thread Andrey Vagin
On Tue, Sep 25, 2018 at 12:02:32AM +0200, Eric W. Biederman wrote: > Andrey Vagin writes: > > > On Fri, Sep 21, 2018 at 02:27:29PM +0200, Eric W. Biederman wrote: > >> Dmitry Safonov writes: > >> > >> > Discussions around time virtualization are there

Re: [RFC 00/20] ns: Introduce Time Namespace

2018-09-24 Thread Andrey Vagin
On Fri, Sep 21, 2018 at 02:27:29PM +0200, Eric W. Biederman wrote: > Dmitry Safonov writes: > > > Discussions around time virtualization are there for a long time. > > The first attempt to implement time namespace was in 2006 by Jeff Dike. > > From that time, the topic appears on and off in vario

Re: [linux-next] Kernel panic while tetsing criu

2018-08-16 Thread Andrey Vagin
On Thu, Aug 16, 2018 at 06:18:35PM +0300, Cyrill Gorcunov wrote: > On Thu, Aug 16, 2018 at 09:51:36AM -0500, Eric W. Biederman wrote: > ... > > > > That patch is incorrect as it misses the rcu_read_unlock. > > > > > > p.s. Andrew noticed the problem and asked me to notify, > > > also he has been t

Re: [PATCH 2/2] fs/lock: show locks taken by processes from another pidns

2018-06-19 Thread Andrey Vagin
On Thu, Jun 14, 2018 at 07:00:07AM -0400, Jeff Layton wrote: > On Fri, 2018-06-08 at 17:27 +0300, Konstantin Khorenko wrote: > > Currently if we face a lock taken by a process invisible in the current > > pidns we skip the lock completely, but this > > > > 1) makes the output not that nice > >

Re: [PATCH 2/2] fs/lock: show locks taken by processes from another pidns

2018-06-11 Thread Andrey Vagin
On Fri, Jun 08, 2018 at 05:27:12PM +0300, Konstantin Khorenko wrote: > Currently if we face a lock taken by a process invisible in the current > pidns we skip the lock completely, but this > > 1) makes the output not that nice > (root@vz7)/: cat /proc/${PID_A2}/fdinfo/3 > pos:4 > f

Re: [PATCH 1/2] fs/lock: skip lock owner pid translation in case we are in init_pid_ns

2018-06-11 Thread Andrey Vagin
/proc/${PID_A2}/fdinfo/3 > pos:4 > flags: 0212 > mnt_id: 257 > lock: (root@vz7)/: > > After the patch: > === > (root@vz7)/:cat /proc/${PID_A2}/fdinfo/3 > pos:4 > flags: 0212 > mnt_id: 295 > lock: 1: FLOCK ADVISORY WRITE $

Re: [PATCH] mnt: allow to add a mount into an existing group

2017-05-09 Thread Andrey Vagin
On Tue, Jan 24, 2017 at 02:03:23PM +1300, Eric W. Biederman wrote: > Andrei Vagin writes: > > > Now a shared group can be only inherited from a source mount. > > This patch adds an ability to add a mount into an existing shared > > group. > > This sounds like a lot of the discussion on bind mounts

Re: [inotify] fee1df54b6: BUG_kmalloc-#(Not_tainted):Freepointer_corrupt

2016-12-13 Thread Andrey Vagin
On Tue, Dec 13, 2016 at 11:34 AM, Nikolay Borisov wrote: > > > On 13.12.2016 20:51, Eric W. Biederman wrote: >> Nikolay Borisov writes: >> >>> So this thing resurfaced again and I took a hard look into the code but >>> couldn't find anything suspicious. So the allocating and freeing >>> contexts

Re: [ISSUE] mm: Add a user_ns owner to mm_struct and fix ptrace_may_access

2016-10-24 Thread Andrey Vagin
On Mon, Oct 24, 2016 at 01:59:59PM +0300, Cyrill Gorcunov wrote: > Hi Eric! A few days ago we've noticed that our zombie00 test case started > failing: > https://ci.openvz.org/job/CRIU/view/All/job/CRIU-linux-next/406/console > --- > Run zdtm/static/zombie00 in h > ==

Re: [PATCH] net: skip genenerating uevents for network namespaces that are exiting

2016-10-22 Thread Andrey Vagin
Hi Cong, On Thu, Oct 20, 2016 at 10:25 PM, Andrey Vagin wrote: > On Thu, Oct 20, 2016 at 8:10 PM, Cong Wang wrote: >> On Thu, Oct 20, 2016 at 7:46 PM, Andrei Vagin wrote: >>> No one can see these events, because a network namespace can not be >>> destroyed, if it has

Re: [PATCH] net: skip genenerating uevents for network namespaces that are exiting

2016-10-20 Thread Andrey Vagin
On Thu, Oct 20, 2016 at 8:10 PM, Cong Wang wrote: > On Thu, Oct 20, 2016 at 7:46 PM, Andrei Vagin wrote: >> No one can see these events, because a network namespace can not be >> destroyed, if it has sockets. >> > > Are you sure? kobject_uevent_env() seems sending uevents to all > network namespa

Re: [RFC][PATCH] mount: In mark_umount_candidates and __propogate_umount visit each mount once

2016-10-13 Thread Andrey Vagin
On Thu, Oct 13, 2016 at 2:46 PM, Andrei Vagin wrote: > On Thu, Oct 13, 2016 at 02:53:46PM -0500, Eric W. Biederman wrote: >> >> Adrei Vagin pointed out that time to executue propagate_umount can go >> non-linear (and take a ludicrious amount of time) when the mount >> propogation trees of the moun

Re: [PATCH 1/4] kernel: add a helper to get an owning user namespace for a namespace

2016-08-31 Thread Andrey Vagin
On Tue, Aug 30, 2016 at 7:41 PM, Serge E. Hallyn wrote: > On Fri, Aug 26, 2016 at 04:08:08PM -0700, Andrei Vagin wrote: >> From: Andrey Vagin >> >> Return -EPERM if an owning user namespace is outside of a process >> current user namespace. >> >> v2: I

Re: [PATCH 1/4] kernel: add a helper to get an owning user namespace for a namespace

2016-08-31 Thread Andrey Vagin
On Tue, Aug 30, 2016 at 7:56 PM, Serge E. Hallyn wrote: > On Fri, Aug 26, 2016 at 04:08:08PM -0700, Andrei Vagin wrote: >> +struct ns_common *ns_get_owner(struct ns_common *ns) >> +{ >> + struct user_namespace *my_user_ns = current_user_ns(); >> + struct user_namespace *owner, *p; >> + >>

Re: [PATCH 0/5 RFC] Add an interface to discover relationships between namespaces

2016-07-22 Thread Andrey Vagin
On Thu, Jul 21, 2016 at 11:48 PM, Michael Kerrisk (man-pages) wrote: > Hi Andrey, > > > On 07/21/2016 11:06 PM, Andrew Vagin wrote: >> >> On Thu, Jul 21, 2016 at 04:41:12PM +0200, Michael Kerrisk (man-pages) >> wrote: >>> >>> Hi Andrey, &g

[PATCH 3/3] selftests: check O_ATROOT and AT_FDROOT flags

2016-07-20 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/lookup/.gitignore | 1 + tools/testing/selftests/lookup/Makefile | 8 +++ tools/testing/selftests/lookup/lookup_at_root.c | 71 + tools/testing

[PATCH 0/3 v3] fs: allow to use dirfd as root for openat and other *at syscalls

2016-07-20 Thread Andrey Vagin
t; Cc: Arnd Bergmann Cc: "J. Bruce Fields" Cc: Miklos Szeredi Cc: NeilBrown Cc: Shuah Khan Cc: Omar Sandoval Signed-off-by: Andrey Vagin Andrey Vagin (3): namei: add LOOKUP_DFD_ROOT to use dfd as root fs: allow to use dirfd as root for openat and

[PATCH 2/3 v2] fs: allow to use dirfd as root for openat and other *at syscalls

2016-07-20 Thread Andrey Vagin
and in this case we need these new flags O_ATROOT or AT_FDROOT. If O_ATROOT is set for openat() or AT_FDROOT is set for fstatat, linkat, unlinkat, path_init is executed with the LOOKUP_DFD_ROOT flag. v2: fix a value of O_ATROOT to not intersect with other constans Signed-off-by: Andrey Vagin

[PATCH 1/3 v2] namei: add LOOKUP_DFD_ROOT to use dfd as root

2016-07-20 Thread Andrey Vagin
this we add this new flag. If LOOKUP_DFD_ROOT is set, path_init() initializes nd->root and nd->path to the same value. Changes since v1: * initialize nd->root_seq (thanks to Omar Sandoval for reporting and fixing this issue) Cc: Omar Sandoval Signed-off-by: Andrey Vagin --- f

[PATCH 4/5] nsfs: add ioctl to get a parent namespace

2016-07-14 Thread Andrey Vagin
Pid and user namepaces are hierarchical. There is no way to discover parent-child relationships. In a future we will use this interface to dump and restore nested namespaces. Signed-off-by: Andrey Vagin --- fs/nsfs.c | 4 include/linux/proc_ns.h | 1 + include/uapi

[PATCH 3/5] nsfs: add ioctl to get an owning user namespace for ns file descriptor

2016-07-14 Thread Andrey Vagin
, Eric W. Biederman proposed to use ioctl-s for this purpose. The NS_GET_USERNS ioctl returns a file descriptor to an owning user namespace. It returns EPERM if a target namespace is outside of a current user namespace. Link: https://lkml.org/lkml/2016/7/6/158 Signed-off-by: Andrey Vagin --- fs

[PATCH 1/5] namespaces: move user_ns into ns_common

2016-07-14 Thread Andrey Vagin
ommon. Originally this idea was suggested by James Bottomley. Signed-off-by: Andrey Vagin --- drivers/net/bonding/bond_main.c | 2 +- drivers/net/tun.c | 4 ++-- fs/mount.h | 1 - fs/namespace.c | 14 +++--

[PATCH 5/5] tools/testing: add a test to check nsfs ioctl-s

2016-07-14 Thread Andrey Vagin
. Signed-off-by: Andrey Vagin --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/nsfs/Makefile | 12 + tools/testing/selftests/nsfs/owner.c | 91 +++ tools/testing/selftests/nsfs/pidns.c | 74 4 files changed

[PATCH 2/5] kernel: add a helper to get an owning user namespace for a namespace

2016-07-14 Thread Andrey Vagin
Return -EPERM if an owning user namespace is outside of a process current user namespace. Signed-off-by: Andrey Vagin --- include/linux/user_namespace.h | 7 +++ kernel/user_namespace.c| 24 2 files changed, 31 insertions(+) diff --git a/include/linux

Re: [PATCH 0/5 RFC] Add an interface to discover relationships between namespaces

2016-07-14 Thread Andrey Vagin
Hello, I forgot to add --cc-cover for git send-email, so everyone who is in Cc got only a cover letter. All messages were sent in mail lists. Sorry for inconvenience. On Thu, Jul 14, 2016 at 11:20 AM, Andrey Vagin wrote: > Each namespace has an owning user namespace and now there is not

[PATCH 1/5] namespaces: move user_ns into ns_common

2016-07-14 Thread Andrey Vagin
ommon. Originally this idea was suggested by James Bottomley. Signed-off-by: Andrey Vagin --- drivers/net/bonding/bond_main.c | 2 +- drivers/net/tun.c | 4 ++-- fs/mount.h | 1 - fs/namespace.c | 14 +++--

[PATCH 4/5] nsfs: add ioctl to get a parent namespace

2016-07-14 Thread Andrey Vagin
Pid and user namepaces are hierarchical. There is no way to discover parent-child relationships. In a future we will use this interface to dump and restore nested namespaces. Signed-off-by: Andrey Vagin --- fs/nsfs.c | 4 include/linux/proc_ns.h | 1 + include/uapi

[PATCH 5/5] tools/testing: add a test to check nsfs ioctl-s

2016-07-14 Thread Andrey Vagin
. Signed-off-by: Andrey Vagin --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/nsfs/Makefile | 12 + tools/testing/selftests/nsfs/owner.c | 91 +++ tools/testing/selftests/nsfs/pidns.c | 74 4 files changed

[PATCH 2/5] kernel: add a helper to get an owning user namespace for a namespace

2016-07-14 Thread Andrey Vagin
Return -EPERM if an owning user namespace is outside of a process current user namespace. Signed-off-by: Andrey Vagin --- include/linux/user_namespace.h | 7 +++ kernel/user_namespace.c| 24 2 files changed, 31 insertions(+) diff --git a/include/linux

[PATCH 3/5] nsfs: add ioctl to get an owning user namespace for ns file descriptor

2016-07-14 Thread Andrey Vagin
, Eric W. Biederman proposed to use ioctl-s for this purpose. The NS_GET_USERNS ioctl returns a file descriptor to an owning user namespace. It returns EPERM if a target namespace is outside of a current user namespace. Link: https://lkml.org/lkml/2016/7/6/158 Signed-off-by: Andrey Vagin --- fs

[PATCH 0/5 RFC] Add an interface to discover relationships between namespaces

2016-07-14 Thread Andrey Vagin
Each namespace has an owning user namespace and now there is not way to discover these relationships. Pid and user namepaces are hierarchical. There is no way to discover parent-child relationships too. Why we may want to know relationships between namespaces? One use would be visualization, in

Re: [PATCH 1/3] namei: add LOOKUP_DFD_ROOT to use dfd as root

2016-07-05 Thread Andrey Vagin
On Fri, Jul 1, 2016 at 5:55 PM, Omar Sandoval wrote: > On Tue, Jun 28, 2016 at 10:38:28AM -0700, Andrey Vagin wrote: >> The problem is that a pathname can contain absolute symlinks and now >> they are resolved relative to the current root. >> >> If we want to o

[PATCH 1/3 v2] namei: add LOOKUP_DFD_ROOT to use dfd as root

2016-07-05 Thread Andrey Vagin
this we add this new flag. If LOOKUP_DFD_ROOT is set, path_init() initializes nd->root and nd->path to the same value. Changes since v1: * initialize nd->root_seq (thanks to Omar Sandoval for reporting and fixing this issue) Cc: Omar Sandoval Signed-off-by: Andrey Vagin --- f

[PATCH 0/3 v2] fs: allow to use dirfd as root for openat and other *at syscalls

2016-06-28 Thread Andrey Vagin
ink to /run. Changes since the first version: - change a value of O_ATROOT to not intersect with other constants. Cc: Alexander Viro Cc: "Eric W. Biederman" Cc: Arnd Bergmann Cc: "J. Bruce Fields" Cc: Miklos Szeredi Cc: NeilBrown Cc: Shuah Khan Signed-off-by: Andrey Vag

[PATCH 3/3] selftests: check O_ATROOT and AT_FDROOT flags

2016-06-28 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/lookup/.gitignore | 1 + tools/testing/selftests/lookup/Makefile | 8 +++ tools/testing/selftests/lookup/lookup_at_root.c | 71 + tools/testing

[PATCH 2/3] fs: allow to use dirfd as root for openat and other *at syscalls

2016-06-28 Thread Andrey Vagin
and in this case we need these new flags O_ATROOT or AT_FDROOT. If O_ATROOT is set for openat() or AT_FDROOT is set for fstatat, linkat, unlinkat, path_init is executed with the LOOKUP_DFD_ROOT flag. v2: fix a value of O_ATROOT to not intersect with other constans Signed-off-by: Andrey Vagin

[PATCH 1/3] namei: add LOOKUP_DFD_ROOT to use dfd as root

2016-06-28 Thread Andrey Vagin
this we add this new flag. If LOOKUP_DFD_ROOT is set, path_init() initializes nd->root and nd->path to the same value. Signed-off-by: Andrey Vagin --- fs/namei.c| 12 +++- include/linux/namei.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/n

[PATCH] tcp: add an ability to dump and restore window parameters

2016-06-27 Thread Andrey Vagin
bed above. Cc: Pavel Emelyanov Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: James Morris Cc: Hideaki YOSHIFUJI Cc: Patrick McHardy Signed-off-by: Andrey Vagin --- include/uapi/linux/tcp.h | 10 + net/ipv4/tcp.c | 57 ++

[PATCH 0/2] [RFC] fs: allow to use dirfd as root for openat and other *at syscalls

2016-06-17 Thread Andrey Vagin
_ATROOT); close(dirfd); One more thing is that chroot isn't avaliable for unprivileged users. We met this problem, when we tryed to dump an ubuntu container and failed to resolve /proc/PID/root/var/run/mysqld/mysqld.sock, because /var/run was a symlink to /run. Cc: Alexander Vir

[PATCH 1/2] namei: add LOOKUP_DFD_ROOT to use dfd as root

2016-06-17 Thread Andrey Vagin
this we add this new flag. Signed-off-by: Andrey Vagin --- fs/namei.c| 12 +++- include/linux/namei.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index 70580ab..5f08b69 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2148,7

[PATCH 2/2] fs: allow to use dirfd as root for openat and other *at syscalls

2016-06-17 Thread Andrey Vagin
namespace and in this case you can use a new flag O_ATROOT or AT_FDROOT. Signed-off-by: Andrey Vagin --- fs/exec.c| 4 +++- fs/namei.c | 10 ++ fs/open.c| 6 +- fs/stat.c| 4 +++- fs/utimes.c

[PATCH] tcp: extend window to fit all restored unacked data in a send queue

2016-05-31 Thread Andrey Vagin
this seq, becuse tcp_sequence() returns false (seq < tp->rcv_nxt). Cc: Pavel Emelyanov Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: James Morris Cc: Hideaki YOSHIFUJI Cc: Patrick McHardy Signed-off-by: Andrey Vagin --- net/ipv4/tcp_output.c | 4 1 file changed, 4 inserti

Re: task_diag: add a new interface to get information about processes

2016-05-04 Thread Andrey Vagin
Hi Stephen, On Wed, May 4, 2016 at 1:22 PM, Stephen Hemminger wrote: > I understand how reading /proc or /sys can be a bottleneck, but this > proposed method using a system call is the wrong way to do this. > > Why not use netlink like other systems do which allows a message > based response whic

[PATCH 03/15] proc: export next_tgid()

2016-04-11 Thread Andrey Vagin
It's going to be used in task_diag Signed-off-by: Andrey Vagin --- fs/proc/base.c | 6 +- fs/proc/internal.h | 6 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 614f1d0..9e5fd1c 100644 --- a/fs/proc/base.c +++ b/fs/proc/b

[PATCH 06/15] task_diag: add a new group to get tasks memory mappings (v2)

2016-04-11 Thread Andrey Vagin
: | struct task_diag_vma | filename | ... Cc: David Ahern Signed-off-by: Andrey Vagin --- fs/proc/internal.h | 21 fs/proc/task_diag.c| 279 - fs/proc/task_mmu.c | 18 +-- include/uapi/linux/task_diag.h | 85

[PATCH 04/15] task_diag: add a new interface to get information about tasks (v4)

2016-04-11 Thread Andrey Vagin
instead of netlink Cc: David Ahern Signed-off-by: Andrey Vagin --- fs/proc/Kconfig| 13 ++ fs/proc/Makefile | 3 + fs/proc/task_diag.c| 424 + include/uapi/linux/task_diag.h | 66 +++ 4 files changed, 506

[PATCH 01/15] proc: pick out a function to iterate task children

2016-04-11 Thread Andrey Vagin
This function will be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/array.c| 53 + fs/proc/internal.h | 3 +++ 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index b6c00ce

[PATCH 10/15] task_diag: add a new group to get resource usage

2016-04-11 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c| 92 ++ include/uapi/linux/task_diag.h | 15 +++ 2 files changed, 107 insertions(+) diff --git a/fs/proc/task_diag.c b/fs/proc/task_diag.c index cd10374..c8499f2 100644 --- a/fs/proc

[PATCH 11/15] task_diag: add a new group to get memory usage

2016-04-11 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c| 79 ++ include/uapi/linux/task_diag.h | 21 +++ 2 files changed, 100 insertions(+) diff --git a/fs/proc/task_diag.c b/fs/proc/task_diag.c index c8499f2..3dc3617 100644 --- a/fs/proc

[PATCH 09/15] task_diag: add a flag to mark incomplete messages

2016-04-11 Thread Andrey Vagin
If all information about a process don't fit in a message, it's marked by the TASK_DIAG_FLAG_CONT flag and the next message will describe the same process. Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c| 3 +++ include/uapi/linux/task_diag.h | 2 ++ 2 files

[PATCH 13/15] selftest: check the task_diag functinonality

2016-04-11 Thread Andrey Vagin
Here are two test (example) programs. task_diag - request information for two processes. test_diag_all - request information about all processes v2: Fixes from David Ahern: * task_diag: Fix 8-byte alignment for vma and vma_stats Signed-off-by: Andrey Vagin --- tools/testing/selftests

[PATCH 14/15] task_diag: Enhance fork tool to spawn threads

2016-04-11 Thread Andrey Vagin
From: David Ahern Add option to fork threads as well as processes. Make the sleep time configurable too so that spawned tasks exit on their own. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- tools/testing/selftests/task_diag/Makefile | 2 ++ tools/testing/selftests/task_diag

[PATCH 12/15] Documentation: add documentation for task_diag

2016-04-11 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- Documentation/accounting/task_diag.txt | 57 ++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/accounting/task_diag.txt diff --git a/Documentation/accounting/task_diag.txt b/Documentation/accounting

[PATCH 08/15] task_diag: Only add VMAs for thread_group leader

2016-04-11 Thread Andrey Vagin
From: David Ahern threads of a process share the same VMAs, so when dumping all threads for all processes only push vma data for group leader. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion

[PATCH 07/15] task_diag: add ability to dump children and threads

2016-04-11 Thread Andrey Vagin
Now we can dump all task or children, threads of a specified task. It's an example how this interface can be expanded for different use-cases. v2: Fixes from David Ahern Add missing break in iter_stop Fix 8-byte alignment issues Cc: David Ahern Signed-off-by: Andrey Vagin --- fs

[PATCH 15/15] test: check that task_diag can dump all thread of one process

2016-04-11 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- tools/testing/selftests/task_diag/_run.sh | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/task_diag/_run.sh b/tools/testing/selftests/task_diag/_run.sh index 559f02a..d2e8544 100755 --- a/tools/testing/selftests/task_diag/_run.sh

[PATCH 02/15] proc: export task_first_tid() and task_next_tid()

2016-04-11 Thread Andrey Vagin
It will be more convenient when this function will be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/base.c | 8 fs/proc/internal.h | 4 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index b1755b2..614f1d0 100644

[PATCH 0/15] task_diag: add a new interface to get information about processes (v3)

2016-04-11 Thread Andrey Vagin
ode that creates netlink sockets suddenly starts capturing > brand-new rights that didn't exist as part of a netlink socket before. Cc: Oleg Nesterov Cc: Andrew Morton Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Roger Luethi Cc: Arnd Bergmann Cc: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Andy Lutomirski Cc: Pavel Odintsov Signed-off-by: Andrey Vagin -- 2.1.0

[PATCH 05/15] task_diag: add a new group to get process credentials

2016-04-11 Thread Andrey Vagin
fsuid; __u32 gid; __u32 egid; __u32 sgid; __u32 fsgid; }; This group is optional and it's filled only if show_flags contains TASK_DIAG_SHOW_CRED. Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c| 50 ++ include/uapi/

[PATCH] autofs: don't stuck in a loop if vfs_write returns an error

2016-03-31 Thread Andrey Vagin
From: Andrey Vagin __vfs_write() returns a negative value in a error case. Cc: Ian Kent Signed-off-by: Andrey Vagin --- fs/autofs4/waitq.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 0146d91..631f155 100644 --- a/fs

[PATCH] blk-cgroup: don't leak blkcg->pd elements

2015-07-15 Thread Andrey Vagin
0xbb/0x150 [] SyS_mkdir+0x7a/0xe0 [] entry_SYSCALL_64_fastpath+0x12/0x71 [] 0x Fixes: e48453c386f3 ('block, cgroup: implement policy-specific per-blkcg data') Signed-off-by: Andrey Vagin --- block/blk-cgroup.c | 4 1 file changed, 4 insertions(+) di

Re: [PATCH 0/24] kernel: add a netlink interface to get information about processes (v2)

2015-07-08 Thread Andrey Vagin
M -0700, Andy Lutomirski wrote: >>> >> On Mon, Jul 6, 2015 at 1:47 AM, Andrey Vagin wrote: >>> >> > Currently we use the proc file system, where all information are >>> >> > presented in text files, what is convenient for humans. But if we n

[PATCH 04/24] kernel: move next_tgid from fs/proc

2015-07-06 Thread Andrey Vagin
This function will be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/base.c | 43 --- include/linux/proc_fs.h | 7 +++ kernel/pid.c| 39 +++ 3 files changed, 46 insertions(+), 43

[PATCH 07/24] task_diag: add a new group to get process credentials

2015-07-06 Thread Andrey Vagin
; __u32 suid; __u32 fsuid; __u32 gid; __u32 egid; __u32 sgid; __u32 fsgid; }; This group is optional and it's filled only if show_flags contains TASK_DIAG_SHOW_CRED. Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h

[PATCH 05/24] task_diag: add ability to get information about all tasks

2015-07-06 Thread Andrey Vagin
For that we need to set NLM_F_DUMP. A response contain on a few packets. Signed-off-by: Andrey Vagin --- include/linux/taskstats_kern.h | 2 ++ kernel/taskdiag.c | 40 kernel/taskstats.c | 1 + 3 files changed, 43 insertions

[PATCH 08/24] proc: pick out a function to iterate task children

2015-07-06 Thread Andrey Vagin
This function will be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/array.c | 67 ++--- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index ce065cf..52c4a7b 100644 --- a/fs/proc

[PATCH 03/24] kernel: make taskstats available from all net namespaces

2015-07-06 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- kernel/taskstats.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/taskstats.c b/kernel/taskstats.c index d70f1e5..0c90d11 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -47,6 +47,7 @@ struct genl_family taskstats_family = { .name

[PATCH 01/24] kernel: define taststats commands in the one place

2015-07-06 Thread Andrey Vagin
Currently if we add a new TASKSTATS_ constant, we will chanage all CGROUPSTATS_ contants and break backward compatibility. Signed-off-by: Andrey Vagin --- include/uapi/linux/cgroupstats.h | 15 --- include/uapi/linux/taskstats.h | 7 +++ 2 files changed, 7 insertions(+), 15

[PATCH 10/24] task_diag: add ability to dump children (v2)

2015-07-06 Thread Andrey Vagin
Now we can dump all task or children of a specified task. It's an example how this interface can be expanded for different use-cases. v2: Fixes from David Ahern Add missing break in iter_stop Fix 8-byte alignment issues Cc: David Ahern Signed-off-by: Andrey Vagin --- include

[PATCH 0/24] kernel: add a netlink interface to get information about processes (v2)

2015-07-06 Thread Andrey Vagin
ask_diag. Cc: Oleg Nesterov Cc: Andrew Morton Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Roger Luethi Cc: Arnd Bergmann Cc: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Andy Lutomirski Cc: Pavel Odintsov Signed-off-by: Andrey Vagin -- 2.1.0 -- To unsubscribe from this list: send the line "

[PATCH 06/24] task_diag: add ability to split per-task data on a few netlink messages

2015-07-06 Thread Andrey Vagin
The size of requested per-task data can be bigger that the size of one netlink skb. Currently we are able to split data into a few netlink messages. v2: set NLM_F_MULTI for multipart packets Signed-off-by: Andrey Vagin --- kernel/taskdiag.c | 76

[PATCH 16/24] proc: move first_tid and next_tid out of proc

2015-07-06 Thread Andrey Vagin
They will be used in task_diag Signed-off-by: Andrey Vagin --- fs/proc/base.c | 79 ++--- include/linux/proc_fs.h | 4 +++ kernel/pid.c| 76 +++ 3 files changed, 82 insertions(+), 77

[PATCH 12/24] task_diag: add a new group to get tasks memory mappings (v2)

2015-07-06 Thread Andrey Vagin
as: | struct task_diag_vma | filename | ... Cc: David Ahern Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 54 + kernel/taskdiag.c | 255 - 2 files changed, 306 insertions(+), 3 deletions(-) diff --git a/include

[PATCH 18/24] task_diag: add ability to handle one task in a continious mode

2015-07-06 Thread Andrey Vagin
If a task has many vma-s, the size of information about them can be too big to be placed into one skb. Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 1 + kernel/taskdiag.c | 17 + 2 files changed, 18 insertions(+) diff --git a/include/uapi/linux

[PATCH 15/24] proc: give task_struct instead of pid into first_tid

2015-07-06 Thread Andrey Vagin
It will be more convenient when this function will be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/base.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 88cf6ae..af797d9 100644 --- a/fs/proc/base.c

[PATCH 22/24] Documentation: add documentation for task_diag

2015-07-06 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- Documentation/accounting/task_diag.txt | 53 ++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/accounting/task_diag.txt diff --git a/Documentation/accounting/task_diag.txt b/Documentation/accounting

[PATCH 20/24] task_diag: Only add VMAs for thread_group leader

2015-07-06 Thread Andrey Vagin
From: David Ahern threads of a process share the same VMAs, so when dumping all threads for all processes only push vma data for group leader. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- kernel/taskdiag.c | 17 + 1 file changed, 13 insertions(+), 4 deletions

[PATCH 23/24] selftest: check the task_diag functinonality

2015-07-06 Thread Andrey Vagin
Here are two test (example) programs. task_diag - request information for two processes. test_diag_all - request information about all processes v2: Fixes from David Ahern: * task_diag: Fix 8-byte alignment for vma and vma_stats Signed-off-by: Andrey Vagin --- tools/testing/selftests

[PATCH 11/24] task_diag: add a new group to get task statistics

2015-07-06 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/linux/taskstats_kern.h | 2 ++ include/uapi/linux/task_diag.h | 2 ++ kernel/taskdiag.c | 30 ++ kernel/taskstats.c | 2 +- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/include/linux

[PATCH 09/24] proc: move task_next_child() from fs/proc

2015-07-06 Thread Andrey Vagin
It's going to be used in task_diag. Signed-off-by: Andrey Vagin --- fs/proc/array.c | 53 - include/linux/proc_fs.h | 3 +++ kernel/pid.c| 53 + 3 files changed, 56 inser

[PATCH 17/24] task_diag: add ability to dump theads

2015-07-06 Thread Andrey Vagin
Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 1 + kernel/taskdiag.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/task_diag.h b/include/uapi/linux/task_diag.h index 9e4c3c4..e1d09e6 100644 --- a/include

[PATCH 24/24] task_diag: Enhance fork tool to spawn threads

2015-07-06 Thread Andrey Vagin
From: David Ahern Add option to fork threads as well as processes. Make the sleep time configurable too so that spawned tasks exit on their own. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- tools/testing/selftests/task_diag/Makefile | 2 ++ tools/testing/selftests/task_diag

[PATCH 21/24] task diag: Add support for TGID attribute

2015-07-06 Thread Andrey Vagin
From: David Ahern Add TGID attribute and put in every message. This is need for perf for example when processing messages with maps. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 1 + kernel/taskdiag.c | 8 +++- 2 files changed

[PATCH 19/24] task_diag: Add option to dump all threads for all tasks

2015-07-06 Thread Andrey Vagin
From: David Ahern New dump strategy to walk all threads of all processes. Signed-off-by: David Ahern Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 7 +++--- kernel/taskdiag.c | 55 -- 2 files changed, 52 insertions

[PATCH 13/24] task_diag: shows memory consumption for memory mappings (v2)

2015-07-06 Thread Andrey Vagin
The same information are shown in /proc/self/smaps. v2: account the task_diag_vma_stat struct in taskdiag_packet_size() Fix 8-byte alignment for vma and vma_stats // David Ahern Cc: David Ahern Signed-off-by: Andrey Vagin --- fs/proc/task_mmu.c | 14 + include/linux

[PATCH 14/24] task_diag: add a marcos to enumirate memory mappings

2015-07-06 Thread Andrey Vagin
This macros will help users to use this interface. v2: Fix task_diag_for_each_vma to work with libnl // David Ahern Signed-off-by: Andrey Vagin --- include/uapi/linux/task_diag.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/uapi/linux/task_diag.h b/include/uapi/linux

[PATCH 02/24] kernel: add a netlink interface to get information about tasks (v2)

2015-07-06 Thread Andrey Vagin
Add max attr enum task diag: Send pid as u32 Change _MSG/msg references to base Fix 8-byte alignment Cc: David Ahern Signed-off-by: Andrey Vagin --- include/linux/taskstats_kern.h | 7 ++ include/uapi/linux/task_diag.h | 60 +++ include/uapi/linux/taskstats.h | 2

[PATCH] fs: show locked and lock_ro options in mountinfo

2015-03-27 Thread Andrey Vagin
I don't see any reasons to hide them. This information can help to understand errors. And this information is required for correct checkpoint/restore of mount namespaces. Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Eric W. Biederman Cc: Alexander Viro Signed-off-by: Andrey Vagin --

[PATCH] selftests: check that execveat returns negative values in case of errors

2015-03-13 Thread Andrey Vagin
Currently we check that execveat returns non-positive value when an error is expected. But we need to check that execveat() doesn't return zero in such cases too. Cc: Shuah Khan Signed-off-by: Andrey Vagin --- tools/testing/selftests/exec/execveat.c | 2 +- 1 file changed, 1 insertion(

[PATCH v2] selftests/kcmp: exit with non-zero code in a fail case

2015-03-13 Thread Andrey Vagin
Currently this test always returs zero code and a child process returns non-zero code only if the last testcase failed. v2: don't forget to return smth from ksft_exit() Cc: Michael Ellerman Cc: Shuah Khan Cc: Cyrill Gorcunov Signed-off-by: Andrey Vagin --- tools/testing/selftests

[PATCH] selftests/exec: take into account that zero is a success code

2015-03-13 Thread Andrey Vagin
Cc: Shuah Khan Signed-off-by: Andrey Vagin --- tools/testing/selftests/exec/execveat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index e238c95..6747a3f 100644 --- a/tools/testing

[PATCH] selftests/kcmp: exit with non-zero code in a fail case (v2)

2015-03-13 Thread Andrey Vagin
Currently this test always returs zero code and a child process returns non-zero code only if the last testcase failed. v2: don't forget to return smth from ksft_exit() Cc: Michael Ellerman Cc: Shuah Khan Cc: Cyrill Gorcunov Signed-off-by: Andrey Vagin --- tools/testing/selftests

[PATCH] selftests/kcmp: exit with non-zero code in a fail case

2015-03-13 Thread Andrey Vagin
Currently this test always returs zero code and a child process returns non-zero code only if the last testcase failed. Cc: Shuah Khan Cc: Cyrill Gorcunov Signed-off-by: Andrey Vagin --- tools/testing/selftests/kcmp/kcmp_test.c | 16 ++-- tools/testing/selftests/kselftest.h

[PATCH] selftest: add a test case to check how locks are shown in fdinfo

2015-03-12 Thread Andrey Vagin
The main idea of this test is to check that locks are shown correctly when they can't be placed in a default seq_file buffer due to its size. Cc: Andrew Morton Cc: Shuah Khan Signed-off-by: Andrey Vagin --- tools/testing/selftests/Makefile| 1 + tools/testing/selftests/f

[PATCH] proc: show locks in /proc/pid/fdinfo/X

2015-03-05 Thread Andrey Vagin
Cc: "J. Bruce Fields" Cc: Andrew Morton Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Signed-off-by: Andrey Vagin --- Documentation/filesystems/proc.txt | 4 fs/locks.c | 38 ++ fs/proc/fd.c | 27 +

[PATCH 3/7] task-diag: add ability to get information about all tasks

2015-02-17 Thread Andrey Vagin
For that we need to set NLM_F_DUMP. Currently here are no filters. Any suggestions are welcome. I think we can add request for children, threads, session or group members. Signed-off-by: Andrey Vagin --- kernel/taskdiag.c | 41 + 1 file changed, 41

  1   2   3   >