Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whiteout files and opaque directories should not be copied to the lower filesystem? #3

Open
x11x opened this issue Sep 23, 2017 · 2 comments

Comments

@x11x
Copy link

x11x commented Sep 23, 2017

Maybe this is by design...
Say you have a lower filesystem, "/lower" containing a directory "/lower/d" and a file "lower/f".
Then you mount an overlay, "/overlay" using an empty upper filesystem, "/upper".
Then rm -rf /overlay/d /overlay/f.
Using overlay merge -l /lower -u /upper command, in the generated shell script you get

rm -rf '/lower/d'
mv -T '/upper/d' '/lower/d'
rm -rf '/lower/f'
mv -T '/upper/f' '/lower/f'

The whiteout file and opaque directory from /upper are moved in after deleting the existing file.
I guess its a simple find 1-liner to find these files and delete them from "/lower" if you don't want them but I wonder if overlayfs-tools should either not copy these files in the first place or provide an option not to copy them.

@x11x
Copy link
Author

x11x commented Sep 24, 2017

This is really odd, I can't reproduce this now! Maybe it was the way I set up my mounts originally. I think the mount point for the overlay might have been within the upper directory, which could have messed things up.
This can be closed if no one can reproduce, but maybe there's an edge case here.

@kmxz
Copy link
Owner

kmxz commented Sep 24, 2017

Whiteout file should be deleted. It's definitely a bug if the problem can be reproduced.

However, with previous implementation, the whiteout file should already be removed, as

return command(script_stream, "rm -r %", lower_path) || command(script_stream, "rm %", upper_path);
did rm the whiteout file.

Let's keep this issue open to see if anyone can reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants