diff --git a/pkg/volume/cephfs/cephfs.go b/pkg/volume/cephfs/cephfs.go index 59f72a248d184..837438764010f 100644 --- a/pkg/volume/cephfs/cephfs.go +++ b/pkg/volume/cephfs/cephfs.go @@ -232,7 +232,10 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error { if !notMnt { return nil } - os.MkdirAll(dir, 0750) + + if err := os.MkdirAll(dir, 0750); err != nil { + return err + } // check whether it belongs to fuse, if not, default to use kernel mount. if cephfsVolume.checkFuseMount() { @@ -253,6 +256,7 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error { } } glog.V(4).Infof("CephFS kernel mount.") + err = cephfsVolume.execMount(dir) if err != nil { // cleanup upon failure. diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 0183b36a09d6b..24198a676d560 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -262,8 +262,9 @@ func (b *glusterfsMounter) SetUpAt(dir string, fsGroup *int64) error { if !notMnt { return nil } - - os.MkdirAll(dir, 0750) + if err := os.MkdirAll(dir, 0750); err != nil { + return err + } err = b.setUpAtInternal(dir) if err == nil { return nil