Merge pull request #307 from estesp/no-remount-if-unecessary
Only remount if requested flags differ from current
This commit is contained in:
commit
fba07bce72
|
@ -171,9 +171,14 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// bind mount won't change mount options, we need remount to make mount options effective.
|
// bind mount won't change mount options, we need remount to make mount options effective.
|
||||||
|
// first check that we have non-default options required before attempting a remount
|
||||||
|
if m.Flags&^(syscall.MS_REC|syscall.MS_REMOUNT|syscall.MS_BIND) != 0 {
|
||||||
|
// only remount if unique mount options are set
|
||||||
if err := remount(m, rootfs); err != nil {
|
if err := remount(m, rootfs); 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