Created attachment 1065364 [details] Script to reproduce the issue reliably (run as root) Description of problem: When an OverlayFS is mounted with a Btrfs filesystem as the upper layer and the user attempts to remove a directory in the overlay that exists only in the lower filesystem, the directory whiteout character device is not created in the upper filesystem, nor does the directory appear to be removed in the overlay. This issue is reproducible regardless of the filesystem type of the lower filesystem, and does not reproduce when other filesystem types such as ext4 are used as the upper filesystem. Version-Release number of selected component (if applicable): kernel-4.1.5-200.fc22 kernel-4.0.9-200.fc21 How reproducible: Always Steps to Reproduce: Use attached script as root Actual results: Directory "deleted" is still there Expected results: Directory "deleted" should be gone Additional info: This issue was originally discovered on CentOS 7.1, and reproduced on Fedora (with its kernels) and Arch (with mainline kernels).
It is almost certainly best to email upstream directly about this issue.
Who should I contact?
[jwboyer@lando linux]$ ./scripts/get_maintainer.pl -f fs/overlayfs/ Miklos Szeredi <miklos> (supporter:OVERLAY FILESYSTEM) linux-unionfs.org (open list:OVERLAY FILESYSTEM) linux-kernel.org (open list) [jwboyer@lando linux]$ ./scripts/get_maintainer.pl -f fs/btrfs/ Chris Mason <clm> (maintainer:BTRFS FILE SYSTEM) Josef Bacik <jbacik> (maintainer:BTRFS FILE SYSTEM) David Sterba <dsterba> (maintainer:BTRFS FILE SYSTEM) linux-btrfs.org (open list:BTRFS FILE SYSTEM) linux-kernel.org (open list) [jwboyer@lando linux]$ You are welcome to CC David Howells and myself if you'd like as well.
Done.
Created attachment 1066408 [details] strace output for "rm -rf" on a btrfs+tmpfs overlayfs It looks like unlink("/path/to/dir", AT_REMOVEDIR) returns -EINVAL. The strace output is attached.
Update: Further testing has revealed the following new data: - The bug also affects ext4 in CentOS's latest 3.10-based kernel, but not 4.x kernels in Fedora or ArchLinux - The bug also affects xfs in all kernel versions
*********** 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.
This issue remains present in kernel 4.2.3-200.fc22.
If I remember correctly, Miklos pointed out that filesystems need to support RENAME_EXCHANGE and RENAME_WHITEOUT to have overlayfs actually be fully functional. Btrfs doesn't so overlayfs isn't really expected to work. I'm ignoring CentOS kernels in this bug. That should be filed with CentOS. Closing this bug out as UPSTREAM, as that is where the work needs to be done and the Fedora kernel maintainers are not likely to get around to doing it.