Skip to content

Commit

Permalink
check function return err
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyee committed Dec 19, 2017
1 parent 622386e commit b6e1fec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/volume/cephfs/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions pkg/volume/glusterfs/glusterfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,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
Expand Down

0 comments on commit b6e1fec

Please sign in to comment.