Merge pull request #236 from hqhq/hq_fix_cgroup_rw
Always remount for bind mount
This commit is contained in:
commit
486ac97618
|
@ -165,11 +165,10 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
|
||||||
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil {
|
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if m.Flags&syscall.MS_RDONLY != 0 {
|
// bind mount won't change mount options, we need remount to make mount options effective.
|
||||||
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags|syscall.MS_REMOUNT), ""); err != nil {
|
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags|syscall.MS_REMOUNT), ""); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if m.Relabel != "" {
|
if m.Relabel != "" {
|
||||||
if err := label.Validate(m.Relabel); err != nil {
|
if err := label.Validate(m.Relabel); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue