diff --git a/pkg/volume/fc/fc_util.go b/pkg/volume/fc/fc_util.go index f229d5700d6..050785c4221 100644 --- a/pkg/volume/fc/fc_util.go +++ b/pkg/volume/fc/fc_util.go @@ -219,6 +219,10 @@ func (util *FCUtil) AttachDisk(b fcDiskMounter) (string, error) { } // mount it globalPDPath := util.MakeGlobalPDName(*b.fcDisk) + if err := os.MkdirAll(globalPDPath, 0750); err != nil { + return devicePath, fmt.Errorf("fc: failed to mkdir %s, error", globalPDPath) + } + noMnt, err := b.mounter.IsLikelyNotMountPoint(globalPDPath) if err != nil { return devicePath, fmt.Errorf("Heuristic determination of mount point failed:%v", err) @@ -228,10 +232,6 @@ func (util *FCUtil) AttachDisk(b fcDiskMounter) (string, error) { return devicePath, nil } - if err := os.MkdirAll(globalPDPath, 0750); err != nil { - return devicePath, fmt.Errorf("fc: failed to mkdir %s, error", globalPDPath) - } - err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, nil) if err != nil { return devicePath, fmt.Errorf("fc: failed to mount fc volume %s [%s] to %s, error %v", devicePath, b.fsType, globalPDPath, err)