Linux419 filesystem proc have problem

What I find

head -n 2 /proc/self/mountinfo
0 0 0:1 / 20 25 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
21 25 0:20 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sys rw

the first line of mountinfo is not formatted as proc(5) — Linux manual page documented.

And this cause docker pull get the error msg

Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
35b42117c431: Extracting [==================================================>]  43.84MB/43.84MB
ad9c569a8d98: Download complete 
293b44f45162: Download complete 
0c175077525d: Download complete 
docker: failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root336598748: device or resource busy.
See 'docker run --help'.

How to reproduce

download manjaro from offical and then switch kernel to 4.19.141-2

Hi, is it a kernel still maintained or is it already EOL?

In Manjaro Settings Manager, it is marked as LTS & Recommended.

I can’t post image and url now because of my new account.

Could you describe what exactly is not formatted correctly? I see it now. I’m pretty sure this is a kernel bug. Have you reported it?

I don’t think it is a kernel bug.

ubuntu with kernel 4.19.141 doesn’t have this problem.

That file is directly generated by the kernel (in fs/proc_namespace.c:show_mountinfo()). There is only a single code path which can result in the output you get (as far as I see), but if the execution takes that path, that is a bug in my opinion (printing the path actually succeeds, but reports an error). Can you check if /proc/self/mounts and /proc/self/mountstats are affected?

The two file:

❯ uname -a
Linux hxzhao-pc 4.19.141-2-MANJARO #1 SMP Sat Aug 22 17:49:27 UTC 2020 x86_64 GNU/Linux
❯ head -n 2 /proc/self/mountinfo
0 0 0:1 / 20 25 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
21 25 0:20 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sys rw
❯ cat /proc/self/mounts
rootfs proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
dev /dev devtmpfs rw,nosuid,relatime,size=8128740k,nr_inodes=2032185,mode=755 0 0
run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/sdb5 / ext4 rw,noatime,discard 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755 0 0
cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=19801 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /tmp tmpfs rw,noatime 0 0
/dev/sdb2 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/sda3 /opt ext4 rw,noatime,discard 0 0
/dev/sda1 /home ext4 rw,noatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1627632k,nr_inodes=406908,mode=700,uid=1000,gid=1000 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
❯ cat /proc/self/mountstats
device rootfs mounted on device proc mounted on /proc with fstype proc
device sys mounted on /sys with fstype sysfs
device dev mounted on /dev with fstype devtmpfs
device run mounted on /run with fstype tmpfs
device efivarfs mounted on /sys/firmware/efi/efivars with fstype efivarfs
device /dev/sdb5 mounted on / with fstype ext4
device securityfs mounted on /sys/kernel/security with fstype securityfs
device tmpfs mounted on /dev/shm with fstype tmpfs
device devpts mounted on /dev/pts with fstype devpts
device tmpfs mounted on /sys/fs/cgroup with fstype tmpfs
device cgroup2 mounted on /sys/fs/cgroup/unified with fstype cgroup2
device cgroup mounted on /sys/fs/cgroup/systemd with fstype cgroup
device pstore mounted on /sys/fs/pstore with fstype pstore
device bpf mounted on /sys/fs/bpf with fstype bpf
device cgroup mounted on /sys/fs/cgroup/memory with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/net_cls,net_prio with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/rdma with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/cpu,cpuacct with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/cpuset with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/devices with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/freezer with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/hugetlb with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/pids with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/perf_event with fstype cgroup
device cgroup mounted on /sys/fs/cgroup/blkio with fstype cgroup
device systemd-1 mounted on /proc/sys/fs/binfmt_misc with fstype autofs
device hugetlbfs mounted on /dev/hugepages with fstype hugetlbfs
device mqueue mounted on /dev/mqueue with fstype mqueue
device debugfs mounted on /sys/kernel/debug with fstype debugfs
device tracefs mounted on /sys/kernel/tracing with fstype tracefs
device configfs mounted on /sys/kernel/config with fstype configfs
device tmpfs mounted on /tmp with fstype tmpfs
device /dev/sdb2 mounted on /boot/efi with fstype vfat
device /dev/sda3 mounted on /opt with fstype ext4
device /dev/sda1 mounted on /home with fstype ext4
device fusectl mounted on /sys/fs/fuse/connections with fstype fusectl
device tmpfs mounted on /run/user/1000 with fstype tmpfs
device gvfsd-fuse mounted on /run/user/1000/gvfs with fstype fuse.gvfsd-fuse

I checkout the kernel v4.19.141 source from kernel official, but it seems right.

// fs/proc_namespace.c:show_mountinfo()
static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
{
	struct proc_mounts *p = m->private;
	struct mount *r = real_mount(mnt);
	struct super_block *sb = mnt->mnt_sb;
	struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
	int err;

	seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id,
		   MAJOR(sb->s_dev), MINOR(sb->s_dev));
	if (sb->s_op->show_path) {
		err = sb->s_op->show_path(m, mnt->mnt_root);
		if (err)
			goto out;
	} else {
		seq_dentry(m, mnt->mnt_root, " \t\n\\");
	}
	seq_putc(m, ' ');
// ...
}

You can see that those files are affected, too. There’s a “phantom mount”, it seems, that has mount id 0, mount parent id 0, and the device has major id 0, minor id 1. It seems to be of type “rootfs”. Interestingly, it appears to be both valid and invalid at the same time, since it’s only partially printed.

Is it present in runlevel 3? Is there anything about it in /etc/fstab or systemctl list-unit-files -t mount?

I think this can be related to this: https://forum.manjaro.org/t/duplicate-manjaro-entries-in-grub-menu-and-linux-kernel-v4/14834

Not any help, though

I’m wrestling with the exact same problem as well for a couple of days now. I also had similar symptoms as described in “Problems with PolKit after downgrading kernel” (Can’t insert links) though I’m not using PolKit, so it doesn’t seem to be related to that.
I also had the error of seemingly broken link of /etc/mtab. This seems to have been fixed with the recent manjaro update yesterday.
Docker however is still broken even though I used it just a couple of weeks ago. I guess I’m going to upgrade to Kernel 5.4 then.