mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: Set volume mount rslave.
PiperOrigin-RevId: 211111376 Change-Id: I27b8cb4e070d476fa4781ed6ecfa0cf1dcaf85f5
This commit is contained in:
@@ -117,6 +117,12 @@ func setupFS(spec *specs.Spec, conf *boot.Config, bundleDir string) error {
|
||||
if err := syscall.Mount(src, dst, m.Type, uintptr(flags), ""); err != nil {
|
||||
return fmt.Errorf("failed to mount src: %q, dst: %q, flags: %#x, err: %v", src, dst, flags, err)
|
||||
}
|
||||
// Make the mount a slave, so that for recursive bind mount, umount won't
|
||||
// propagate to the source.
|
||||
flags = syscall.MS_SLAVE | syscall.MS_REC
|
||||
if err := syscall.Mount("", dst, "", uintptr(flags), ""); err != nil {
|
||||
return fmt.Errorf("failed to rslave mount dst: %q, flags: %#x, err: %v", dst, flags, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Remount root as readonly after setup is done, if requested.
|
||||
|
||||
Reference in New Issue
Block a user