mount: handle a circular reference in mount tree
mount: handle a circular reference in mount tree

$ 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.

0'th mount is rootfs, which is mounted in init_mount_tree().

We don't see it in cases when system makes chroot, because of

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\\");

Cc: beproject criu <67ebad5cf4f156c95f7558a39139bc63912fae09@gmail.com>
Cc: Christopher Covington <a4bb60c1cee4bc57e495283536ad4f6d94bfb161@codeaurora.org>
Reported-by: beproject criu <67ebad5cf4f156c95f7558a39139bc63912fae09@gmail.com>
Reviewed-by: Christopher Covington <a4bb60c1cee4bc57e495283536ad4f6d94bfb161@codeaurora.org>
Signed-off-by: Andrey Vagin <74c05afa918858348d6db8037d82fa8124870113@openvz.org>
Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@parallels.com>

gonkulator/criu,marcosnils/criu,gablg1/criu,tych0/criu,KKoukiou/criu-remote,eabatalov/criu,gablg1/criu,svloyso/criu,svloyso/criu,rentzsch/criu,KKoukiou/criu-remote,LK4D4/criu,AuthenticEshkinKot/criu,rentzsch/criu,biddyweb/criu,ldu4/criu,tych0/criu,svloyso/criu,gonkulator/criu,LK4D4/criu,eabatalov/criu,wtf42/criu,tych0/criu,ldu4/criu,fbocharov/criu,biddyweb/criu,biddyweb/criu,fbocharov/criu,ldu4/criu,efiop/criu,gablg1/criu,fbocharov/criu,fbocharov/criu,ldu4/criu,LK4D4/criu,gablg1/criu,svloyso/criu,sdgdsffdsfff/criu,wtf42/criu,ldu4/criu,wtf42/criu,AuthenticEshkinKot/criu,efiop/criu,fbocharov/criu,AuthenticEshkinKot/criu,gonkulator/criu,marcosnils/criu,sdgdsffdsfff/criu,efiop/criu,KKoukiou/criu-remote,sdgdsffdsfff/criu,ldu4/criu,biddyweb/criu,tych0/criu,svloyso/criu,AuthenticEshkinKot/criu,rentzsch/criu,KKoukiou/criu-remote,eabatalov/criu,gablg1/criu,eabatalov/criu,biddyweb/criu,LK4D4/criu,tych0/criu,rentzsch/criu,marcosnils/criu,marcosnils/criu,eabatalov/criu,rentzsch/criu,sdgdsffdsfff/criu,biddyweb/criu,rentzsch/criu,wtf42/criu,sdgdsffdsfff/criu,tych0/criu,gonkulator/criu,sdgdsffdsfff/criu,AuthenticEshkinKot/criu,efiop/criu,marcosnils/criu,gonkulator/criu,gonkulator/criu,LK4D4/criu,eabatalov/criu,KKoukiou/criu-remote,fbocharov/criu,gablg1/criu,svloyso/criu,wtf42/criu,marcosnils/criu,wtf42/criu,AuthenticEshkinKot/criu,efiop/criu,KKoukiou/criu-remote,efiop/criu,LK4D4/criu