Merge pull request #56851 from zouyee/ceph-1

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check function return err

**What this PR does / why we need it**:
check function return err

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```NONE

```
pull/6/head
Kubernetes Submit Queue 2018-01-10 03:12:28 -08:00 committed by GitHub
commit 6b925ac24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -232,7 +232,10 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
if !notMnt { if !notMnt {
return nil 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. // check whether it belongs to fuse, if not, default to use kernel mount.
if cephfsVolume.checkFuseMount() { if cephfsVolume.checkFuseMount() {
@ -253,6 +256,7 @@ func (cephfsVolume *cephfsMounter) SetUpAt(dir string, fsGroup *int64) error {
} }
} }
glog.V(4).Infof("CephFS kernel mount.") glog.V(4).Infof("CephFS kernel mount.")
err = cephfsVolume.execMount(dir) err = cephfsVolume.execMount(dir)
if err != nil { if err != nil {
// cleanup upon failure. // cleanup upon failure.

View File

@ -262,8 +262,9 @@ func (b *glusterfsMounter) SetUpAt(dir string, fsGroup *int64) error {
if !notMnt { if !notMnt {
return nil return nil
} }
if err := os.MkdirAll(dir, 0750); err != nil {
os.MkdirAll(dir, 0750) return err
}
err = b.setUpAtInternal(dir) err = b.setUpAtInternal(dir)
if err == nil { if err == nil {
return nil return nil