-
Notifications
You must be signed in to change notification settings - Fork 39
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
Introduce deref cmd #11
Conversation
Thanks for the PR! I'll take a look quickly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the massive improvements!
I'm not very familiar with the updates in OverlayFS, so I'm not confident in proofreading the logic. But the code surely looks great. I'll definitely merge it.
diff treats redirect dir as opaque - - lower files under redirect dir listed as deleted - upper dir listed as added vaccum also treats redirect dir as opaque - - it must not delete redirect upper dir becaue we do not know how to follow redirect to lower merge with redirect dir is complicated and not supported - - we abort merge when detecting a redirect dir to avoid deleting files under the redirected dir Signed-off-by: Amir Goldstein <[email protected]>
Data of metacopy upper is identical to lower by definition unless upper is redirected, so diff and vacuum work. merge is more complicated, so it is aborted if an upper metacopy is found. Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
Comforms to the output format of 'diff -qr --no-dereference'. Signed-off-by: Amir Goldstein <[email protected]>
Expected output of 'overlay diff' is comitted as diff.saved. Expected output of 'overlay diff -v' is comitted as verbose.saved. Expected output of 'overlay diff -b' is generated with 'diff -qr'. Signed-off-by: Amir Goldstein <[email protected]>
It is not a real metacopy because it is missing the origin xattr, but for the diff tests it is sufficient. In the test data set, the victim file was unmodified, only permission bits changed, so diff results remain the same. Signed-off-by: Amir Goldstein <[email protected]>
"fake" that lower removed_dir was actually renamed and not removed, so all its children can be found under renamed_dir. The diff output results of diff and diff -b have an extra line for added directory /renamed_dir. The diff output of diff -v should have the children of renamed_dir, but overlay tools does not support listing redirected dir's childeren, so it also has that single added directory /renamed_dir. Signed-off-by: Amir Goldstein <[email protected]>
Instead of using full paths in script, use paths relative to $LOWERDIR and $UPPERDIR variables. Signed-off-by: Amir Goldstein <[email protected]>
For layers modifying scripts 'vaccuum' and 'merge' allow specifying command line arguments -L <newlower> and -U <newupper>. If those arguments are specified, the script will make a backup copy of lowerdir and/or upperdir and will make modifications to the backup copy instead of modifying the original. If niether upperdir nor lowerdir are going to be modified, relax the check for mounted overlayfs. Signed-off-by: Amir Goldstein <[email protected]>
copy changes from upperdir to a new upperdir unfolding redirect and metacopy to get a portable overlay upperdir layer. Signed-off-by: Amir Goldstein <[email protected]>
Merged. Much appreciation for the great contribution! |
deref - copy changes from
upperdir
touppernew
while unfolding redirect directories and metacopy regular files, so that new upperdir is compatible with legacy overlayfs driver.