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
d8c33485
Unverified
Commit
d8c33485
authored
May 22, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 22, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74880 from smileusd/fix-IsLikelyNotMountPoint-function
distinguish between mountpoints and symbolic link in IsNotMountPoint
parents
c2633d89
a81f7704
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
mount.go
pkg/util/mount/mount.go
+1
-1
mount_linux.go
pkg/util/mount/mount_linux.go
+1
-0
No files found.
pkg/util/mount/mount.go
View file @
d8c33485
...
...
@@ -53,7 +53,7 @@ type Interface interface {
// is a mountpoint.
// It should return ErrNotExist when the directory does not exist.
// IsLikelyNotMountPoint does NOT properly detect all mountpoint types
// most notably linux bind mounts.
// most notably linux bind mounts
and symbolic link
.
IsLikelyNotMountPoint
(
file
string
)
(
bool
,
error
)
// DeviceOpened determines if the device is in use elsewhere
// on the system, i.e. still mounted.
...
...
pkg/util/mount/mount_linux.go
View file @
d8c33485
...
...
@@ -228,6 +228,7 @@ func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {
// IsLikelyNotMountPoint determines if a directory is not a mountpoint.
// It is fast but not necessarily ALWAYS correct. If the path is in fact
// a bind mount from one part of a mount to another it will not be detected.
// It also can not distinguish between mountpoints and symbolic links.
// mkdir /tmp/a /tmp/b; mount --bind /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b")
// will return true. When in fact /tmp/b is a mount point. If this situation
// if of interest to you, don't use this function...
...
...
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