diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index be0631c630..52324fdd30 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -97,24 +97,19 @@ func Mounted(mountpoint string) (bool, error) { return len(entries) > 0, nil } -// Mount will mount filesystem according to the specified configuration, on the -// condition that the target path is *not* already mounted. Options must be -// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See -// flags.go for supported option flags. +// Mount will mount filesystem according to the specified configuration. +// Options must be specified like the mount or fstab unix commands: +// "opt1=val1,opt2=val2". See flags.go for supported option flags. func Mount(device, target, mType, options string) error { flag, data := parseOptions(options) - if flag&REMOUNT != REMOUNT { - if mounted, err := Mounted(target); err != nil || mounted { - return err - } - } return mount(device, target, mType, uintptr(flag), data) } -// ForceMount will mount a filesystem according to the specified configuration, -// *regardless* if the target path is not already mounted. Options must be -// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See -// flags.go for supported option flags. +// Mount will mount filesystem according to the specified configuration. +// Options must be specified like the mount or fstab unix commands: +// "opt1=val1,opt2=val2". See flags.go for supported option flags. +// +// Deprecated: use Mount instead. func ForceMount(device, target, mType, options string) error { flag, data := parseOptions(options) return mount(device, target, mType, uintptr(flag), data)