Description of problem: Let me try to explain the background: In main thread: We use mount --bind source target mount --make-shared target to create this shared mount point `target` And then we use `CLONE_NEWNS` to clone a child thread(Only sleep, do nothing). So far everything looks normal. And then in main thread, we umount the `target` successfully. According this kernel document: [sharedsubtree](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). The child thread should also see the `target` has already umount although the child thread is started by `CLONE_NEWNS`. But the problem apprears now: In child process, we cat `/proc/self/mountinfo` and found `target` still exists! This is an unmatch behaviour in above document. In main process, we cat `/proc/self/mountinfo` and found `taregt` has already unmount. Now we could not rmdir `target` folder because child is still holding this shared mount point. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. (In main thread) mount --bind source target 2. (In main thread) mount --make-shared target 3. Clone a new child thread with CLONE_NEWNS 4. (In child thread) just sleep, do nothing 5. (In main thread) umount target 6. (In main thread) rm -rf target Actual results: rmdir return 'Device or resource busy'. The mount informations about target are inconsistent between child and parent processes Expected results: rmdir success Additional info:
It also could reproduce through shell. 1. (In main bash) mount --bind /tmp/source /tmp/target 2. (In main bash) mount --make-shared /tmp/target 3. (Start child bash) unshare -m /bin/bash 4. (In main bash) umount /tmp/target 5. (In main bash) rmdir /tmp/target return `Device or resource busy` 6. (In main bash) cat /proc/self/mountinfo could not see /tmp/target 7. (In child bash) cat /proc/self/mountinfo could found /tmp/target ``` 78 48 8:3 /tmp/source /tmp/target rw,relatime shared:1 - ext4 /dev/disk/by-uuid/98708f21-a59d-4b80-a85c-27b78c22e316 rw,errors=remount-ro,data=ordered ```
Filesystem handles basic system directory layout. It has nothing to do with filesystems generally. Let's move it to kernel filesystem subcomponent, however it may be reassigned later to something else. Adding Eric Sandeen to cc - as he takes care of ext4 (which is mentioned as a filesystem here).
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 22 kernel bugs. Fedora 22 has now been rebased to 4.2.3-200.fc22. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you have moved on to Fedora 23, and are still experiencing this issue, please change the version to Fedora 23. If you experience different issues, please open a new bug report for those.
*********** MASS BUG UPDATE ************** This bug is being closed with INSUFFICIENT_DATA as there has not been a response in over 4 weeks. If you are still experiencing this issue, please reopen and attach the relevant data from the latest kernel you are running and any data that might have been requested previously.