R Rolf Neugebauer #
Hi several docker users reported long stalls when they used containers with network filesystem mounts. For example, this was reported here: https://github.com/moby/moby/issues/5618#issuecomment-314515980. Another user, Pierre Carru (@piec on GH), then managed to create a simpler reproduction here: https://github.com/piec/docker-samba-loop which I analysed initially here: https://github.com/moby/moby/issues/5618#issuecomment-318432218 I managed to condense a repro down to a simple script below, which does not rely on docker. - Configure and start a SMB server on the host - Create a veth pair and configure one peer in the root namespace - Create a network namespace and move and configure the other veth peer there - Execute a (mount.cifs; ls; unmount) inside the network namespace (and in its own mount namespace, though the mount namespace is not strictly required) - Direclty after the 'unmount', delete the network namespace and try to create a new network namespace Creating the new namespace is stalling for around 200 seconds and there 20 odd messages on the console, like: [ 67.372603] unregister_netdevice: waiting for lo to become free. Usage count = 1 Adding a 'sleep 1' before deleting the original network namespace "solves" the issue, but that doesn't sound like a good fix. Not using unmount also does not help (understandable). While the creation of the new namespace is stalled, I used 'sysrq' a few times to dump the work queues. There is an example below. Also, the hung task detection kicks in after 120 seconds (also below) I can readily reproduce this on 4.9.39, 4.11.12 and another user repro-ed it on 4.12.3. It seems to happen every time. At least one user reported issues with NFS mounts as well, but we were not able to reproduce it. It's not clear to me if this is directly related to 'mount.cifs' or if that just happens to reliably repro it.