Kirill Kolyshkin: > It happens in Docker's aufs graph driver (which does not use mount.aufs > but rather calls mount() syscall directly, and does the same for umount > except it calls auplink flush beforehand). Previously, we had a global lock :::
So your scenario is - taskA: + assume the given dir is /somewhere/mntpntA + issue mount(2) for the dir + run auplink for the dir + and then issue umount(2) for the dir - run taskA repeatedly - run the same task repeatedly in parallel, with giving the dir dedicated for each task. - it is 100% sure that mount(2) succeeded before auplink (for the same dir) starts. But /proc/mounts sometimes doesn't show the mntpnt correctly, and auplilnk cannot get it. Hmm, it sounds like a problem in /proc/mounts kernel-space. But I cannot believe easily that such bug exists. Won't you post your kernel info (version, patches, etc)? And can we reproduce the problem easily using a shell script like this (which uses tmpfs instead of aufs)? ---------------------------------------- #!/bin/sh stopme=/tmp/stopme mntpnt="$(seq -f '/tmp/mntpnt%g' 256)" mkdir -p $mntpnt rm -f $stopme sudo true f() { while test ! -e $stopme do if sudo mount -t tmpfs none $1 then fgrep -q $1 /proc/mounts || { > $stopme return 1 } sudo umount $1 fi done } for i in $mntpnt do f $i & done wait ---------------------------------------- > By the way, this /proc/mounts issue was not the only one; I also discovered > that two parallel mount syscalls sometimes clash on something related to > xino > handling (I guess they concurrently try to access the file without > locking... but > I have yet to look into it). That is really interesting. If you can, please post the clash message (kernel log). Just for your information, for Docker users especially for the very short lived aufs mount, I'd recommend you to try "ephemeral" option. This aufs mount option is handled by /sbin/mount.aufs, and converted into some other options including "noplink,noxino." These options will be helpful for you, as long as you don't want the plink and xino feature. For the details of the option, please refer to aufs manual. J. R. Okajima