-
Notifications
You must be signed in to change notification settings - Fork 620
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
mount-v2: workaround for multiple external bindmounts with no common root #1898
mount-v2: workaround for multiple external bindmounts with no common root #1898
Conversation
Nice! I will try it out tomorrow. |
Codecov Report
@@ Coverage Diff @@
## criu-dev #1898 +/- ##
============================================
+ Coverage 69.20% 69.68% +0.47%
============================================
Files 126 128 +2
Lines 33355 32201 -1154
============================================
- Hits 23083 22438 -645
+ Misses 10272 9763 -509
Continue to review full report at Codecov.
|
@Snorch Would it be possible to add a test for this case? |
I just tested it and it does not seem to help:
To replicate this you can try the following commands:
|
aacedb3
to
0c3edd2
Compare
Sorry it was a stupid mistake:
After this I have test passing:
|
Sure, will do tomorrow. (done) |
The current version of the PR works with runc. Thanks. I also restarted the failing tests. |
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.
LGTM
This helper restores master_id and shared_id of first mount in the sharing group. It first copies sharing from either external source or internal parent sharing group and makes master_id from shared_id. Next it creates new shared_id when needed. All other mounts except first are just copied from the first one. Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
…root It's a problem when while restoring sharing group we need to copy sharing between two mounts with non-intersecting roots, because kernel does not allow it. We have a case opencontainers/runc#3442, where runc adds different devtmpfs file-bindmounts to container and there is no fsroot mount in container for this devtmpfs, thus mount-v2 faces the above problem. Luckily for the case of external mounts which are in one sharing group and which have non-intersecting roots, these mounts likely only have external master with no sharing, so we can just copy sharing from external source and make it slave as a workaround. checkpoint-restore#1886 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
d13d392
to
24bf471
Compare
I've added a more detailed comment in code and also a bit simplified the code by splitting restore_one_sharing function of restoring sharing on first mount of shared group, and reusing it in w/a. This makes clear that w/a is about restoring "other" mount similar to how we've restored "first" mount in case we can't copy from "first". upd: And rechecked runc usecase, looks working after this change. |
It's a problem when while restoring sharing group we need to copy
sharing between to mounts with non-intersecting roots, because kernel
does not allow it.
We have a case opencontainers/runc#3442, where
runc adds different devtmpfs file-bindmounts to container and there is
no fsroot mount in container for this devtmpfs, thus mount-v2 faces the
above problem.
Luckily for the case of external mounts which are in one sharing group
and which have non-intersecting roots, these mounts likely only have
external master with no sharing, so we can just copy sharing from
external source and make it slave as a workaround.
#1886
Signed-off-by: Pavel Tikhomirov ptikhomirov@virtuozzo.com