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
751af3a8
Commit
751af3a8
authored
Jun 22, 2016
by
Kris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump inotify to pickup fix for memory leak
parent
0c4a1021
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
Godeps.json
Godeps/Godeps.json
+2
-2
inotify_linux.go
vendor/golang.org/x/exp/inotify/inotify_linux.go
+15
-9
No files found.
Godeps/Godeps.json
View file @
751af3a8
{
{
"ImportPath"
:
"k8s.io/kubernetes"
,
"ImportPath"
:
"k8s.io/kubernetes"
,
"GoVersion"
:
"go1.6"
,
"GoVersion"
:
"go1.6"
,
"GodepVersion"
:
"v
69
"
,
"GodepVersion"
:
"v
74
"
,
"Packages"
:
[
"Packages"
:
[
"github.com/ugorji/go/codec/codecgen"
,
"github.com/ugorji/go/codec/codecgen"
,
"github.com/onsi/ginkgo/ginkgo"
,
"github.com/onsi/ginkgo/ginkgo"
,
...
@@ -1973,7 +1973,7 @@
...
@@ -1973,7 +1973,7 @@
},
},
{
{
"ImportPath"
:
"golang.org/x/exp/inotify"
,
"ImportPath"
:
"golang.org/x/exp/inotify"
,
"Rev"
:
"
d00e13ec443927751b2bd49e97dea7bf3b6a6487
"
"Rev"
:
"
292a51b8d262487dab23a588950e8052d63d9113
"
},
},
{
{
"ImportPath"
:
"golang.org/x/net/context"
,
"ImportPath"
:
"golang.org/x/net/context"
,
...
...
vendor/golang.org/x/exp/inotify/inotify_linux.go
View file @
751af3a8
...
@@ -144,6 +144,10 @@ func (w *Watcher) RemoveWatch(path string) error {
...
@@ -144,6 +144,10 @@ func (w *Watcher) RemoveWatch(path string) error {
return
os
.
NewSyscallError
(
"inotify_rm_watch"
,
errno
)
return
os
.
NewSyscallError
(
"inotify_rm_watch"
,
errno
)
}
}
delete
(
w
.
watches
,
path
)
delete
(
w
.
watches
,
path
)
// Locking here to protect the read from paths in readEvents.
w
.
mu
.
Lock
()
delete
(
w
.
paths
,
int
(
watch
.
wd
))
w
.
mu
.
Unlock
()
return
nil
return
nil
}
}
...
@@ -197,17 +201,19 @@ func (w *Watcher) readEvents() {
...
@@ -197,17 +201,19 @@ func (w *Watcher) readEvents() {
// the "Name" field with a valid filename. We retrieve the path of the watch from
// the "Name" field with a valid filename. We retrieve the path of the watch from
// the "paths" map.
// the "paths" map.
w
.
mu
.
Lock
()
w
.
mu
.
Lock
()
event
.
Name
=
w
.
paths
[
int
(
raw
.
Wd
)]
name
,
ok
:
=
w
.
paths
[
int
(
raw
.
Wd
)]
w
.
mu
.
Unlock
()
w
.
mu
.
Unlock
()
if
nameLen
>
0
{
if
ok
{
// Point "bytes" at the first byte of the filename
event
.
Name
=
name
bytes
:=
(
*
[
syscall
.
PathMax
]
byte
)(
unsafe
.
Pointer
(
&
buf
[
offset
+
syscall
.
SizeofInotifyEvent
]))
if
nameLen
>
0
{
// The filename is padded with NUL bytes. TrimRight() gets rid of those.
// Point "bytes" at the first byte of the filename
event
.
Name
+=
"/"
+
strings
.
TrimRight
(
string
(
bytes
[
0
:
nameLen
]),
"
\0
00"
)
bytes
:=
(
*
[
syscall
.
PathMax
]
byte
)(
unsafe
.
Pointer
(
&
buf
[
offset
+
syscall
.
SizeofInotifyEvent
]))
// The filename is padded with NUL bytes. TrimRight() gets rid of those.
event
.
Name
+=
"/"
+
strings
.
TrimRight
(
string
(
bytes
[
0
:
nameLen
]),
"
\0
00"
)
}
// Send the event on the events channel
w
.
Event
<-
event
}
}
// Send the event on the events channel
w
.
Event
<-
event
// Move to the next event in the buffer
// Move to the next event in the buffer
offset
+=
syscall
.
SizeofInotifyEvent
+
nameLen
offset
+=
syscall
.
SizeofInotifyEvent
+
nameLen
}
}
...
...
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