-
Notifications
You must be signed in to change notification settings - Fork 660
Fix trailing / when a file is bind-mounted #2682
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
Fix trailing / when a file is bind-mounted #2682
Conversation
Code looks correct. But maybe it's better to instead remove trailing slashes in plain_mountpoint in or just after detect_is_dir() where we know if it's file or directory bindmount. There is no signed-off-by in the commit message, @eagleonhill can you please update the commit to have:
Also while on it, please add "mount: " prefix to your commit subject and put PR description into commit message to explain things. I believe fix is simple enough to merge without test (if it's confirmed that it helps in this situation). But we need a regression test in zdtm so that we know that we don't break this case in future. |
273c529
to
898d79f
Compare
E.g. I have a /etc/hosts in workspace mounted from the host, and get the following message. (00.141008) 1: mnt-v2: Create plain mountpoint /tmp/.criu.mntns.K1biY1/mnt-0000000938 for 938 (00.141546) 1: mnt-v2: Mounting unsupported @938 (0) (00.141887) 1: mnt-v2: Bind /tmp/agent/1-d8c746c6fda3a8b2/workspace/etc/hosts/ to /tmp/.criu.mntns.K1biY1/mnt-0000000938 (00.142179) 1: Error (criu/mount-v2.c:319): mnt-v2: Failed to open_tree /tmp/agent/1-d8c746c6fda3a8b2/workspace/etc/hosts/: Not a directory (00.143774) Error (criu/cr-restore.c:2320): Restoring FAILED. Signed-off-by: Chuan Qiu <[email protected]>
898d79f
to
dc830c3
Compare
I've rewrote the test
|
LGTM. Thanks a lot. |
The test creates a file bindmount in criu mntns and binds it into test mntns, this external file bindmount is autodetected and restored via "--external mnt[]" criu option. Note: In previous patch we fix the problem on this code path where file bindmount restore fails as there is excess "/" in source path. Signed-off-by: Pavel Tikhomirov <[email protected]>
dc830c3
to
dfee193
Compare
Still one test fails:
I will look next week, but this does not reproduce on my node (also I'm not sure how fix in resolve_external_mounts can affect env00 test without automatic external mount resolving...). |
Thanks for updating the test. Just to confirm this updated test will repro the original issue before the fix. |
Fix an issue where a trailing
/
is added when a file bind mount is used in check-pointing.E.g. I have a /etc/hosts in workspace mounted from the host, and get the following message.