Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399619 > unrolled thread

Re: cgroup, kernfs: make mountinfo show properly scoped path for cgroup namespaces

Started byAndrei Vagin <avagin@gmail.com>
First post2016-05-12 02:20 +0200
Last post2016-05-12 17:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  Re: cgroup, kernfs: make mountinfo show properly scoped path for  cgroup namespaces Andrei Vagin <avagin@gmail.com> - 2016-05-12 02:20 +0200
    [PATCH] kernfs: kernfs_sop_show_path: don't return 0 after  seq_dentry call "Serge E. Hallyn" <serge.hallyn@ubuntu.com> - 2016-05-12 07:30 +0200
      Re: [PATCH] kernfs: kernfs_sop_show_path: don't return 0 after  seq_dentry call Tejun Heo <tj@kernel.org> - 2016-05-12 17:10 +0200

#1399619 — Re: cgroup, kernfs: make mountinfo show properly scoped path for cgroup namespaces

FromAndrei Vagin <avagin@gmail.com>
Date2016-05-12 02:20 +0200
SubjectRe: cgroup, kernfs: make mountinfo show properly scoped path for cgroup namespaces
Message-ID<rxMwa-2kB-7@gated-at.bofh.it>
Hello,

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=4f41fc59620fcedaa97cbdf3d7d2956d80fcd922

This commit breaks criu:

[root@fc22-vm criu]# ./criu/criu check
Error (mount.c:403): mnt: No root found for mountpoint 35 (@./sys/kernel/debug)

The problem is that mountinfo doesn't contain a /sys mount, so criu
can't build a tree of mounts.

[root@fc22-vm criu]# cat /proc/self/mountinfo  | grep 17
20 17 0:18 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime
shared:7 - securityfs securityfs rw
24 17 0:21 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:8 - tmpfs
tmpfs ro,mode=755
26 17 0:23 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:18
- pstore pstore rw
34 24 0:31 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime
shared:17 - cgroup cgroup rw,freezer
54 17 0:32 / /sys/kernel/config rw,relatime shared:19 - configfs configfs rw
35 17 0:7 / /sys/kernel/debug rw,relatime shared:22 - debugfs debugfs rw

[root@fc22-vm criu]# python
>>> import os
>>> os.open("/sys", os.O_RDONLY)
3
>>>
[1]+  Stopped                 python
[root@fc22-vm criu]# ps
  PID TTY          TIME CMD
  760 pts/0    00:00:00 bash
  913 pts/0    00:00:00 python
  914 pts/0    00:00:00 ps
[root@fc22-vm criu]# cat /proc/913/fdinfo/3
pos: 0
flags: 0100000
mnt_id: 17

Thanks,
Andrew

[toc] | [next] | [standalone]


#1399672 — [PATCH] kernfs: kernfs_sop_show_path: don't return 0 after seq_dentry call

From"Serge E. Hallyn" <serge.hallyn@ubuntu.com>
Date2016-05-12 07:30 +0200
Subject[PATCH] kernfs: kernfs_sop_show_path: don't return 0 after seq_dentry call
Message-ID<rxRma-7la-1@gated-at.bofh.it>
In reply to#1399619
Our caller expects 0 on success, not >0.

This fixes a bug in the patch

	cgroup, kernfs: make mountinfo show properly scoped path for cgroup namespaces

where /sys does not show up in mountinfo, breaking criu.

Thanks for catching this, Andrei.

Reported-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
 fs/kernfs/mount.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index 3b78724..3d670a3 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -50,7 +50,8 @@ static int kernfs_sop_show_path(struct seq_file *sf, struct dentry *dentry)
 	if (scops && scops->show_path)
 		return scops->show_path(sf, node, root);
 
-	return seq_dentry(sf, dentry, " \t\n\\");
+	seq_dentry(sf, dentry, " \t\n\\");
+	return 0;
 }
 
 const struct super_operations kernfs_sops = {
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1400132 — Re: [PATCH] kernfs: kernfs_sop_show_path: don't return 0 after seq_dentry call

FromTejun Heo <tj@kernel.org>
Date2016-05-12 17:10 +0200
SubjectRe: [PATCH] kernfs: kernfs_sop_show_path: don't return 0 after seq_dentry call
Message-ID<ry0pr-8tw-3@gated-at.bofh.it>
In reply to#1399672
On Thu, May 12, 2016 at 12:29:45AM -0500, Serge E. Hallyn wrote:
> Our caller expects 0 on success, not >0.
> 
> This fixes a bug in the patch
> 
> 	cgroup, kernfs: make mountinfo show properly scoped path for cgroup namespaces
> 
> where /sys does not show up in mountinfo, breaking criu.
> 
> Thanks for catching this, Andrei.
> 
> Reported-by: Andrei Vagin <avagin@gmail.com>
> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

Applied to cgroup/for-4.6-fixes.

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web