mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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:
parent
01d4fd76dd
commit
f87afda123
1 changed files with 5 additions and 2 deletions
|
@ -29,9 +29,12 @@ 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 {
|
||||
flag, _ := parseOptions(options)
|
||||
if flag&REMOUNT != REMOUNT {
|
||||
if mounted, err := Mounted(target); err != nil || mounted {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return ForceMount(device, target, mType, options)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue