All of lore.kernel.org
 help / color / mirror / Atom feed
* Question regarding container affecting the host system mounts
@ 2018-03-29 20:50 Ronak Desai
  2018-04-02 15:40 ` Ronak Desai
  0 siblings, 1 reply; 4+ messages in thread
From: Ronak Desai @ 2018-03-29 20:50 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

I came across a problem where if the containers are running then it
affects the unmount process of the system's mount points. I am not
using these mount points as shared mounts with container.

For example, I am using SD card and NAND as external storage device
and mounting it to a mount point in the ramfs. Then I am launching
containers and then when I try to unmount the NAND partition then my
"unmount" call succeeds but I don't see the UBIFS hooks being called
and because of that my UBI detach process fails. When I stopped the
container then I see that kernel is calling the unmount as I see my
debug prints inside the UBIFS for unmounting that partition.

If I tried to mount my NAND partition once the container is up and try
to unmount then it does unmount and detach without issue. It seems
like there is an issue with namespace.

I am using 4.1.8 kernel .  I traced the kernel code and I see that
copy_mnt_ns is calling copy_tree and which basically increasing the
active counts of the super block of my host mount points (NAND, SD cards).
I am using container but I do not wish to share any of my host storage
media with
container so in my container configuration I am only mounting the
tmpfs as the rootfs of container is in in tmpfs of host. But, still I
can't umount completely my host storage media if containers are
running.

I have attached the log of the container start process with debugging
and where you can see it is increasing the super block active counts
for "ubifs".

-- 
Ronak A Desai
Sr. Software Engineer
Airborne Information Solutions / RC Linux Platform Software
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA

Ronak.Desai@rockwellcollins.com

https://www.rockwellcollins.com/

[-- Attachment #2: container_start_with_debugging.txt --]
[-- Type: text/plain, Size: 19919 bytes --]

Starting lxc1 Application: ---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> fs/namespace.c, copy_mnt_ns, 2875
---> fs/namespace.c, copy_tree, 1742
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = rootfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = devpts
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = sysfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = ubifs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = ubifs
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
EXT3-fs (loop0): error: can't find ext3 filesystem on dev loop0.
---> deactivate_locked_super, 284
---> deactivate_locked_super, 288
---> kill_block_super, 1050
---> generic_shutdown_super, 409
---> deactivate_locked_super, 299
---> deactivate_locked_super, 301
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
EXT2-fs (loop0): error: can't find an ext2 filesystem on dev loop0.
---> deactivate_locked_super, 284
---> deactivate_locked_super, 288
---> kill_block_super, 1050
---> generic_shutdown_super, 409
---> deactivate_locked_super, 299
---> deactivate_locked_super, 301
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
EXT4-fs (loop0): VFS: Can't find ext4 filesystem
---> deactivate_locked_super, 284
---> deactivate_locked_super, 288
---> kill_block_super, 1050
---> generic_shutdown_super, 409
---> deactivate_locked_super, 299
---> deactivate_locked_super, 301
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
device veth4YTWEM entered promiscuous mode
---> kern_unmount, 3251
---> mntput_no_expire, 1144
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 321
---> deactivate_super, 323
---> deactivate_locked_super, 284
---> deactivate_locked_super, 288
---> kill_anon_super, 896
---> generic_shutdown_super, 409
---> generic_shutdown_super, 415
---> deactivate_locked_super, 299
---> deactivate_locked_super, 301
---> cleanup_mnt, 1075
device vethXAIUQR entered promiscuous mode
lxcbr1: port 1(vethXAIUQR) entered forwarding state
lxcbr1: port 1(vethXAIUQR) entered forwarding state
lxcbr1: port 1(vethXAIUQR) entered disabled state
---> fs/namespace.c, copy_mnt_ns, 2875
---> fs/namespace.c, copy_tree, 1742
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = rootfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = devpts
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = loop0
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = sysfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = cgroup
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = ubifs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = ubifs
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> free_user_ns, 147
---> free_user_ns, 149
---> free_user_ns, 147
---> free_user_ns, 149
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = loop0
eth0: renamed from vethQMW0V2
eth3: renamed from veth6AR9T2
lxcbr0: port 1(veth4YTWEM) entered forwarding state
lxcbr0: port 1(veth4YTWEM) entered forwarding state
lxcbr1: port 1(vethXAIUQR) entered forwarding state
lxcbr1: port 1(vethXAIUQR) entered forwarding state
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> grab_super, 353, atomic_read(&s->s_active) = 2, name = proc
---> vfs_kern_mount, 953
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = proc
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = proc
---> attach_mnt, 862
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 5, name = proc
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = tmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 5, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 6, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 7, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 8, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 9, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 10, name = devtmpfs
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 5, name = devpts
---> fs/namespace.c, do_loopback, 2176
---> fs/namespace.c, copy_tree, 1742
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = loop0
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 11, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 12, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 13, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 14, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 15, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 16, name = devtmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 6, name = devpts
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 6, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 7, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 8, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 9, name = proc
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = tmpfs
---> fs/namespace.c, copy_tree, 1773
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 5, name = tmpfs
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> do_umount, 1502
---> umount_tree, 1441
---> umount_tree, 1444
---> propagate_mount_unlock, 381
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1450
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> umount_tree, 1457
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> __propagate_umount, 421
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1427
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> umount_tree, 1475
---> disconnect_mount, 1409
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> drop_mountpoint, 199
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> drop_mountpoint, 199
---> mntput_no_expire, 1135
---> SYSC_umount, 1688
---> mntput_no_expire, 1135
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 1, name = tmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 15, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 14, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 13, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 12, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 11, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 10, name = devtmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 5, name = devpts
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 8, name = proc
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 7, name = proc
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 6, name = proc
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 5, name = proc
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 1, name = tmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 4, name = tmpfs
---> cleanup_mnt, 1075
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 3, name = loop0
---> cleanup_mnt, 1075
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> SYSC_umount, 1688
---> alloc_super, 220, atomic_read(&s->s_active) = 1, name = 
---> vfs_kern_mount, 953
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 2, name = devpts
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 3, name = devpts
---> fs/namespace.c, do_loopback, 2181
---> clone_mnt, 1011, atomic_read(&sb->s_active) = 4, name = devpts

##################### umount call is successful but it does not call the UBIFS unmount as it fails in deactivate_super ##################
# umount /opt/logging/
---> do_umount, 1502
---> propagate_mount_busy, 344
---> do_refcount_check, 324
---> umount_tree, 1441
---> umount_tree, 1444
---> propagate_mount_unlock, 381
---> umount_tree, 1450
---> umount_tree, 1457
---> __propagate_umount, 421
---> umount_tree, 1475
---> disconnect_mount, 1392
---> umount_tree, 1477
---> umount_mnt, 834
---> umount_tree, 1490
---> drop_mountpoint, 199
---> SYSC_umount, 1688
---> mntput_no_expire, 1135
---> __cleanup_mnt, 1082
---> cleanup_mnt, 1063
---> cleanup_mnt, 1069
---> cleanup_mnt, 1071
---> cleanup_mnt, 1073
---> deactivate_super, 328, atomic_read(&s->s_active) = 2, name = ubifs
---> cleanup_mnt, 1075
# 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding container affecting the host system mounts
  2018-03-29 20:50 Question regarding container affecting the host system mounts Ronak Desai
@ 2018-04-02 15:40 ` Ronak Desai
  2018-04-02 15:56   ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: Ronak Desai @ 2018-04-02 15:40 UTC (permalink / raw)
  To: linux-kernel

I am able to workaround this issue by marking the mount as unbinadable
and clearing the flag (CL_COPY_UNBINDABLE) in "copy_tree" function in
fs/namespace.c. This skips the unbindable mounts to get cloned inside
the new namespace. For my use-case this is acceptable.

On Thu, Mar 29, 2018 at 3:50 PM, Ronak Desai
<ronak.desai@rockwellcollins.com> wrote:
> I came across a problem where if the containers are running then it
> affects the unmount process of the system's mount points. I am not
> using these mount points as shared mounts with container.
>
> For example, I am using SD card and NAND as external storage device
> and mounting it to a mount point in the ramfs. Then I am launching
> containers and then when I try to unmount the NAND partition then my
> "unmount" call succeeds but I don't see the UBIFS hooks being called
> and because of that my UBI detach process fails. When I stopped the
> container then I see that kernel is calling the unmount as I see my
> debug prints inside the UBIFS for unmounting that partition.
>
> If I tried to mount my NAND partition once the container is up and try
> to unmount then it does unmount and detach without issue. It seems
> like there is an issue with namespace.
>
> I am using 4.1.8 kernel .  I traced the kernel code and I see that
> copy_mnt_ns is calling copy_tree and which basically increasing the
> active counts of the super block of my host mount points (NAND, SD cards).
> I am using container but I do not wish to share any of my host storage
> media with
> container so in my container configuration I am only mounting the
> tmpfs as the rootfs of container is in in tmpfs of host. But, still I
> can't umount completely my host storage media if containers are
> running.
>
> I have attached the log of the container start process with debugging
> and where you can see it is increasing the super block active counts
> for "ubifs".
>
> --
> Ronak A Desai
> Sr. Software Engineer
> Airborne Information Solutions / RC Linux Platform Software
> MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
>
> Ronak.Desai@rockwellcollins.com
>
> https://www.rockwellcollins.com/



-- 
Ronak A Desai
Sr. Software Engineer
Airborne Information Solutions / RC Linux Platform Software
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA

Phone : 319-263-2667 / VPN : 263-2667

Ronak.Desai@rockwellcollins.com

https://www.rockwellcollins.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding container affecting the host system mounts
  2018-04-02 15:40 ` Ronak Desai
@ 2018-04-02 15:56   ` Richard Weinberger
  2018-04-02 16:16     ` Ronak Desai
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2018-04-02 15:56 UTC (permalink / raw)
  To: Ronak Desai; +Cc: LKML, linux-mtd @ lists . infradead . org

Ronak Desai,

On Mon, Apr 2, 2018 at 5:40 PM, Ronak Desai
<ronak.desai@rockwellcollins.com> wrote:
> I am able to workaround this issue by marking the mount as unbinadable
> and clearing the flag (CL_COPY_UNBINDABLE) in "copy_tree" function in
> fs/namespace.c. This skips the unbindable mounts to get cloned inside
> the new namespace. For my use-case this is acceptable.
>
> On Thu, Mar 29, 2018 at 3:50 PM, Ronak Desai
> <ronak.desai@rockwellcollins.com> wrote:
>> I came across a problem where if the containers are running then it
>> affects the unmount process of the system's mount points. I am not
>> using these mount points as shared mounts with container.
>>
>> For example, I am using SD card and NAND as external storage device
>> and mounting it to a mount point in the ramfs. Then I am launching
>> containers and then when I try to unmount the NAND partition then my
>> "unmount" call succeeds but I don't see the UBIFS hooks being called
>> and because of that my UBI detach process fails. When I stopped the
>> container then I see that kernel is calling the unmount as I see my
>> debug prints inside the UBIFS for unmounting that partition.
>>
>> If I tried to mount my NAND partition once the container is up and try
>> to unmount then it does unmount and detach without issue. It seems
>> like there is an issue with namespace.
>>
>> I am using 4.1.8 kernel .  I traced the kernel code and I see that
>> copy_mnt_ns is calling copy_tree and which basically increasing the
>> active counts of the super block of my host mount points (NAND, SD cards).
>> I am using container but I do not wish to share any of my host storage
>> media with
>> container so in my container configuration I am only mounting the
>> tmpfs as the rootfs of container is in in tmpfs of host. But, still I
>> can't umount completely my host storage media if containers are
>> running.
>>
>> I have attached the log of the container start process with debugging
>> and where you can see it is increasing the super block active counts
>> for "ubifs".

Not sure if I understand the problem correctly, isn't this just a matter of
mount point propagation?
See MS_PRIVATE.

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding container affecting the host system mounts
  2018-04-02 15:56   ` Richard Weinberger
@ 2018-04-02 16:16     ` Ronak Desai
  0 siblings, 0 replies; 4+ messages in thread
From: Ronak Desai @ 2018-04-02 16:16 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: LKML, linux-mtd @ lists . infradead . org

On Mon, Apr 2, 2018 at 10:56 AM, Richard Weinberger
<richard.weinberger@gmail.com> wrote:
> Ronak Desai,
>
> On Mon, Apr 2, 2018 at 5:40 PM, Ronak Desai
> <ronak.desai@rockwellcollins.com> wrote:
>> I am able to workaround this issue by marking the mount as unbinadable
>> and clearing the flag (CL_COPY_UNBINDABLE) in "copy_tree" function in
>> fs/namespace.c. This skips the unbindable mounts to get cloned inside
>> the new namespace. For my use-case this is acceptable.
>>
>> On Thu, Mar 29, 2018 at 3:50 PM, Ronak Desai
>> <ronak.desai@rockwellcollins.com> wrote:
>>> I came across a problem where if the containers are running then it
>>> affects the unmount process of the system's mount points. I am not
>>> using these mount points as shared mounts with container.
>>>
>>> For example, I am using SD card and NAND as external storage device
>>> and mounting it to a mount point in the ramfs. Then I am launching
>>> containers and then when I try to unmount the NAND partition then my
>>> "unmount" call succeeds but I don't see the UBIFS hooks being called
>>> and because of that my UBI detach process fails. When I stopped the
>>> container then I see that kernel is calling the unmount as I see my
>>> debug prints inside the UBIFS for unmounting that partition.
>>>
>>> If I tried to mount my NAND partition once the container is up and try
>>> to unmount then it does unmount and detach without issue. It seems
>>> like there is an issue with namespace.
>>>
>>> I am using 4.1.8 kernel .  I traced the kernel code and I see that
>>> copy_mnt_ns is calling copy_tree and which basically increasing the
>>> active counts of the super block of my host mount points (NAND, SD cards).
>>> I am using container but I do not wish to share any of my host storage
>>> media with
>>> container so in my container configuration I am only mounting the
>>> tmpfs as the rootfs of container is in in tmpfs of host. But, still I
>>> can't umount completely my host storage media if containers are
>>> running.
>>>
>>> I have attached the log of the container start process with debugging
>>> and where you can see it is increasing the super block active counts
>>> for "ubifs".
>
> Not sure if I understand the problem correctly, isn't this just a matter of
> mount point propagation?
> See MS_PRIVATE.
The problem is that whenever a container is launched the namespace is
cloned and which clones the whole tree
of the host. Because of that the superblock counts on the mountpoint
is increased and because of that actual
unmount fails(deactivate_super in fs/super.c). umount command returns
success but it does not call the filesystem
specific hooks(kill_sb) to unmount the filesystem. So, in case of UBI,
ubidetach fails. The same applies to other storage
media with ext filesystem.
By default the mounts are MS_PRIVATE so I was not expecting that there
will be any propagation from cloning
but I was wrong. It could be that this has been fixed in upstream
kernel(I could not find specific commit(s)) as I am using 4.1.8
kernel.
>
> --
> Thanks,
> //richard



-- 
Ronak A Desai
Sr. Software Engineer
Airborne Information Solutions / RC Linux Platform Software
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
Ronak.Desai@rockwellcollins.com
https://www.rockwellcollins.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-02 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 20:50 Question regarding container affecting the host system mounts Ronak Desai
2018-04-02 15:40 ` Ronak Desai
2018-04-02 15:56   ` Richard Weinberger
2018-04-02 16:16     ` Ronak Desai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.