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
007e4f06
Commit
007e4f06
authored
May 06, 2016
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24718 from chengyli/cinder-volume
fix cinder volume dir umount issue #24717
parents
303f059e
1fb33aa2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
mount.go
pkg/util/mount/mount.go
+14
-3
No files found.
pkg/util/mount/mount.go
View file @
007e4f06
...
...
@@ -21,6 +21,7 @@ package mount
import
(
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/util/exec"
"path/filepath"
)
type
Interface
interface
{
...
...
@@ -86,8 +87,13 @@ func GetMountRefs(mounter Interface, mountPath string) ([]string, error) {
// Find the device name.
deviceName
:=
""
// If mountPath is symlink, need get its target path.
slTarget
,
err
:=
filepath
.
EvalSymlinks
(
mountPath
)
if
err
!=
nil
{
slTarget
=
mountPath
}
for
i
:=
range
mps
{
if
mps
[
i
]
.
Path
==
mountPath
{
if
mps
[
i
]
.
Path
==
slTarget
{
deviceName
=
mps
[
i
]
.
Device
break
}
...
...
@@ -99,7 +105,7 @@ func GetMountRefs(mounter Interface, mountPath string) ([]string, error) {
glog
.
Warningf
(
"could not determine device for path: %q"
,
mountPath
)
}
else
{
for
i
:=
range
mps
{
if
mps
[
i
]
.
Device
==
deviceName
&&
mps
[
i
]
.
Path
!=
mountPath
{
if
mps
[
i
]
.
Device
==
deviceName
&&
mps
[
i
]
.
Path
!=
slTarget
{
refs
=
append
(
refs
,
mps
[
i
]
.
Path
)
}
}
...
...
@@ -118,8 +124,13 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e
// Find the device name.
// FIXME if multiple devices mounted on the same mount path, only the first one is returned
device
:=
""
// If mountPath is symlink, need get its target path.
slTarget
,
err
:=
filepath
.
EvalSymlinks
(
mountPath
)
if
err
!=
nil
{
slTarget
=
mountPath
}
for
i
:=
range
mps
{
if
mps
[
i
]
.
Path
==
mountPath
{
if
mps
[
i
]
.
Path
==
slTarget
{
device
=
mps
[
i
]
.
Device
break
}
...
...
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