Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c02aeb7e
Commit
c02aeb7e
authored
Aug 09, 2017
by
Yassine TIJANI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle failed mounts for fc volumes
parent
6a0d3c74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
disk_manager.go
pkg/volume/fc/disk_manager.go
+24
-2
No files found.
pkg/volume/fc/disk_manager.go
View file @
c02aeb7e
...
...
@@ -36,7 +36,6 @@ type diskManager interface {
// utility to mount a disk based filesystem
func
diskSetUp
(
manager
diskManager
,
b
fcDiskMounter
,
volPath
string
,
mounter
mount
.
Interface
,
fsGroup
*
int64
)
error
{
globalPDPath
:=
manager
.
MakeGlobalPDName
(
*
b
.
fcDisk
)
// TODO: handle failed mounts here.
noMnt
,
err
:=
mounter
.
IsLikelyNotMountPoint
(
volPath
)
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
...
...
@@ -57,7 +56,30 @@ func diskSetUp(manager diskManager, b fcDiskMounter, volPath string, mounter mou
}
err
=
mounter
.
Mount
(
globalPDPath
,
volPath
,
""
,
options
)
if
err
!=
nil
{
glog
.
Errorf
(
"failed to bind mount:%s"
,
globalPDPath
)
glog
.
Errorf
(
"Failed to bind mount: source:%s, target:%s, err:%v"
,
globalPDPath
,
volPath
,
err
)
noMnt
,
mntErr
:=
b
.
mounter
.
IsLikelyNotMountPoint
(
volPath
)
if
mntErr
!=
nil
{
glog
.
Errorf
(
"IsLikelyNotMountPoint check failed: %v"
,
mntErr
)
return
err
}
if
!
noMnt
{
if
mntErr
=
b
.
mounter
.
Unmount
(
volPath
);
mntErr
!=
nil
{
glog
.
Errorf
(
"Failed to unmount: %v"
,
mntErr
)
return
err
}
noMnt
,
mntErr
=
b
.
mounter
.
IsLikelyNotMountPoint
(
volPath
)
if
mntErr
!=
nil
{
glog
.
Errorf
(
"IsLikelyNotMountPoint check failed: %v"
,
mntErr
)
return
err
}
if
!
noMnt
{
// will most likely retry on next sync loop.
glog
.
Errorf
(
"%s is still mounted, despite call to unmount(). Will try again next sync loop."
,
volPath
)
return
err
}
}
os
.
Remove
(
volPath
)
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment