1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #6669 from pwaller/issue-6652

Allow re-mounting an existing mount with "remount"
This commit is contained in:
Michael Crosby 2014-06-25 14:18:25 -07:00
commit 7be83a0857

View file

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