I have two processes in different mount namespaces. They have a shared directory bind mounted to /mnt/share. The "master" uses MS_SHARED propagation for the mount, while the "slave" uses MS_SLAVE.

The master process sets up a bind mount that is a child of /mnt/share, let's say /mnt/share/sub, and then creates a file /mnt/share/sub-ready. The slave process has an inotify watch on /mnt/share which hears the create event for sub-ready and immediately looks for /mnt/share/sub/sub-file, which it does not find. It is visible to the slave process a fraction of a second later, but not immediately after the sub-ready file is created.

Could it be that while mount certainly returns only after the mount point is created in the caller's namespace, it can return before it has been propagated to other namespaces? Or is there a bug in the plan I have described?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.