Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go-fuse
Commits
1830098f
Commit
1830098f
authored
Sep 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent deadlocks by moving notify outside of mutex.
parent
dd451fd6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
unionfs/memunionfs.go
unionfs/memunionfs.go
+14
-4
No files found.
unionfs/memunionfs.go
View file @
1830098f
...
@@ -167,16 +167,19 @@ func (me *MemUnionFs) Update(results map[string]*Result) {
...
@@ -167,16 +167,19 @@ func (me *MemUnionFs) Update(results map[string]*Result) {
}
}
me
.
mutex
.
Lock
()
me
.
mutex
.
Lock
()
defer
me
.
mutex
.
Unlock
()
notifyNodes
:=
[]
*
fuse
.
Inode
{}
enotifyNodes
:=
[]
*
fuse
.
Inode
{}
enotifyNames
:=
[]
string
{}
sort
.
Strings
(
add
)
sort
.
Strings
(
add
)
for
_
,
n
:=
range
add
{
for
_
,
n
:=
range
add
{
node
,
rest
:=
me
.
connector
.
Node
(
me
.
root
.
Inode
(),
n
)
node
,
rest
:=
me
.
connector
.
Node
(
me
.
root
.
Inode
(),
n
)
if
len
(
rest
)
>
0
{
if
len
(
rest
)
>
0
{
me
.
connector
.
EntryNotify
(
node
,
rest
[
0
])
enotifyNames
=
append
(
enotifyNames
,
rest
[
0
])
enotifyNodes
=
append
(
enotifyNodes
,
node
)
continue
continue
}
}
me
.
connector
.
FileNotify
(
node
,
0
,
0
)
notifyNodes
=
append
(
notifyNodes
,
node
)
mn
:=
node
.
FsNode
()
.
(
*
memNode
)
mn
:=
node
.
FsNode
()
.
(
*
memNode
)
mn
.
original
=
n
mn
.
original
=
n
mn
.
changed
=
false
mn
.
changed
=
false
...
@@ -185,6 +188,14 @@ func (me *MemUnionFs) Update(results map[string]*Result) {
...
@@ -185,6 +188,14 @@ func (me *MemUnionFs) Update(results map[string]*Result) {
mn
.
info
=
*
r
.
FileInfo
mn
.
info
=
*
r
.
FileInfo
mn
.
link
=
r
.
Link
mn
.
link
=
r
.
Link
}
}
me
.
mutex
.
Unlock
()
for
_
,
n
:=
range
notifyNodes
{
me
.
connector
.
FileNotify
(
n
,
0
,
0
)
}
for
i
,
n
:=
range
enotifyNodes
{
me
.
connector
.
EntryNotify
(
n
,
enotifyNames
[
i
])
}
}
}
func
(
me
*
MemUnionFs
)
getFilename
()
string
{
func
(
me
*
MemUnionFs
)
getFilename
()
string
{
...
@@ -372,7 +383,6 @@ func (me *memNode) Rename(oldName string, newParent fuse.FsNode, newName string,
...
@@ -372,7 +383,6 @@ func (me *memNode) Rename(oldName string, newParent fuse.FsNode, newName string,
me
.
fs
.
deleted
[
filepath
.
Join
(
newParent
.
(
*
memNode
)
.
original
,
newName
)]
=
true
me
.
fs
.
deleted
[
filepath
.
Join
(
newParent
.
(
*
memNode
)
.
original
,
newName
)]
=
true
}
}
log
.
Println
(
"materialize"
)
mn
.
materialize
()
mn
.
materialize
()
mn
.
markChanged
()
mn
.
markChanged
()
}
}
...
...
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