-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add some basic bind filter functions #274
Conversation
This change adds the ability to mount a a single folder or a volume inside another folder, using the bind filter API. While the API allows mounting multiple sources inside a single mount point, acting as an overlay, we disable this functionality in the ApplyFileBinding function. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Cross-tagging from #187 (comment): I suggest that once this lands, hcsshim be updated to use this for |
I realise the current layout of this repo is... adventurous... but should this API be somewhere under |
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
I am extremely malleable in regard to this. Any suggestions or preferences are fine with me. |
I added some tests. It would be nice to add some tests with volume mount points, but I am not sure if pulling in |
Thinking more about my earlier thought regarding hcsshim, I just remembered that there's already code in hcsshim that uses Bind Filter (and a syscall wrapper for the one call they use), so converting that to use this API would be a good validation of the API, including questions about generalisation. |
Yup. It's in use in hcsshim. I think we can replace some things in hcsshim with this, but the |
8f965a7
to
fc72bee
Compare
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
fc72bee
to
76c22e3
Compare
* Properly close handle in getFinalPath() * Use string in function signature. mksyscall generates proper code to convert to utf16 * Enable TestRemoveFileBinding on Windows Server 2019 Windows Server 2019 only exposes 2 function in bindfltapi.dll: * BfRemoveMapping * BfSetupFilter Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
There is no way to list mappings on ltsc2019. We can however blindly try to remove a mapping and ignore the error if it's |
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
64bab15
to
258cf20
Compare
707b9e5
to
258cf20
Compare
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
2cccff9
to
841fe89
Compare
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, though I would prefer a review from @msscotb before merging this
* Additionally check if we can write to a read-only mount point, not just delete from it * No need to set FILE_FLAG_OPEN_REPARSE_POINT when opening a file Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
7e79560
to
33c45b1
Compare
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 change adds the ability to mount a a single folder or a volume inside another folder, using the bind filter API.
While the API allows mounting multiple sources inside a single mount point, acting as an overlay, we disable this functionality in the
ApplyFileBinding()
function. We could add anotherflags
parameter to this function to allow using any of the existing flags, making it more generic. Let me know if this is preferred.Tests will be added shortly.
Signed-off-by: Gabriel Adrian Samfira [email protected]