ソースを参照

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)
Peter Waller 11 年 前
コミット
f87afda123
1 ファイル変更5 行追加2 行削除
  1. 5 2
      pkg/mount/mount.go

+ 5 - 2
pkg/mount/mount.go

@@ -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)
 }