Allow re-mounting an existing mount with "remount"

Without this line of code, if a volume is present in /proc/mounts,
it cannot be remounted with new mount options.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
This commit is contained in:
Peter Waller 2014-06-25 09:15:08 +01:00
parent 3b2cc0082b
commit 48a09f34bd

View file

@ -29,8 +29,11 @@ func Mounted(mountpoint string) (bool, error) {
// the target is not mounted // the target is not mounted
// Options must be specified as fstab style // Options must be specified as fstab style
func Mount(device, target, mType, options string) error { func Mount(device, target, mType, options string) error {
if mounted, err := Mounted(target); err != nil || mounted { flag, _ := parseOptions(options)
return err if flag&REMOUNT != REMOUNT {
if mounted, err := Mounted(target); err != nil || mounted {
return err
}
} }
return ForceMount(device, target, mType, options) return ForceMount(device, target, mType, options)
} }