mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
rootfs: use empty src for MS_REMOUNT
The kernel ignores these arguments, and passing them can lead to confusing error messages (the old source is irrelevant for MS_REMOUNT), as well as causing issues for a future patch where we switch to move_mount(2). Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
committed by
Kir Kolyshkin
parent
20b95f23ca
commit
5c7839b503
@@ -1105,7 +1105,7 @@ func writeSystemProperty(key, value string) error {
|
||||
func remount(m mountEntry, rootfs string, noMountFallback bool) error {
|
||||
return utils.WithProcfd(rootfs, m.Destination, func(dstFD string) error {
|
||||
flags := uintptr(m.Flags | unix.MS_REMOUNT)
|
||||
err := mountViaFDs(m.Source, m.srcFD, m.Destination, dstFD, m.Device, flags, "")
|
||||
err := mountViaFDs("", nil, m.Destination, dstFD, m.Device, flags, "")
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -1129,7 +1129,7 @@ func remount(m mountEntry, rootfs string, noMountFallback bool) error {
|
||||
}
|
||||
// ... and retry the mount with flags found above.
|
||||
flags |= uintptr(int(s.Flags) & checkflags)
|
||||
return mountViaFDs(m.Source, m.srcFD, m.Destination, dstFD, m.Device, flags, "")
|
||||
return mountViaFDs("", nil, m.Destination, dstFD, m.Device, flags, "")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user