[CRIU] [PATCH] mount: handle a circular reference in mount tree

Andrew Vagin avagin at parallels.com
Mon Sep 15 12:26:19 PDT 2014


On Mon, Sep 15, 2014 at 10:50:42PM +0400, Pavel Emelyanov wrote:
> On 09/15/2014 10:41 PM, Christopher Covington wrote:
> > On 09/15/2014 08:23 AM, Pavel Emelyanov wrote:
> >> On 09/12/2014 03:41 PM, Andrey Vagin wrote:
> >>> $ cat /proc/self/mountinfo
> >>> ...
> >>> 1 1 0:2 / / rw - rootfs rootfs rw,size=373396k,nr_inodes=93349
> >>> ...
> >>>
> >>> You can see that mnt_id and parent_mnt_id are equals here.
> >>> This patch interpretes this case as a root mount in a tree.
> >>
> >> While I agree with the patch, I'd like to get some info about
> >> how this all happens from the kernel objects perspective.
> >>
> >> The kernel's show_mountinfo() prints this like
> >> seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id,
> >>
> >> which means, that each mnt always has a parent.
> >>
> >> We've typically seen the 0 as root's parent. Where did the kernel
> >> get this mount from?
> > 
> > I've only seen this happen on the initramfs.
> 
> You mean the 0th parent? This is what I see on my laptop:
> 
> 35 0 253:0 / / rw,relatime shared:1 - ext4 /dev/mapper/vg_xemulnb-lv_root rw,data=ordered

0 - rootfs, which is mounted in init_mount_tree().

Pavel, you don't see it, because your system makes chroot:

static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
...
/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
err = seq_path_root(m, &mnt_path, &root, " \t\n\\");

> 
> and pretty much the same in VM with criu
> 
> 35 0 253:1 / / rw,relatime shared:1 - ext4 /dev/mapper/fedora-root rw,data=ordered
> 
> Thanks,
> Pavel
> 


More information about the CRIU mailing list