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
Levin Zimmermann
go-fuse
Commits
5f82a882
Commit
5f82a882
authored
Nov 22, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unmount notify on root node mounts.
parent
978e8f18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
fuse/fsconnector.go
fuse/fsconnector.go
+27
-12
No files found.
fuse/fsconnector.go
View file @
5f82a882
...
...
@@ -315,19 +315,29 @@ func (c *FileSystemConnector) Unmount(node *Inode) Status {
node
.
treeLock
.
Lock
()
defer
node
.
treeLock
.
Unlock
()
mountInode
:=
mount
.
mountInode
if
!
mountInode
.
canUnmount
()
{
if
mount
.
mountInode
!=
node
{
log
.
Panicf
(
"got two different mount inodes %v vs %v"
,
mount
.
mountInode
.
nodeId
,
node
.
nodeId
)
}
if
!
node
.
canUnmount
()
{
return
EBUSY
}
mount
.
mountInode
=
nil
// TODO - racy.
mountI
node
.
mountPoint
=
nil
node
.
mountPoint
=
nil
delete
(
parentNode
.
children
,
name
)
mount
.
fs
.
OnUnmount
()
c
.
fsInit
.
DeleteNotify
(
parentNode
.
nodeId
,
mountInode
.
nodeId
,
name
)
parentId
:=
parentNode
.
nodeId
if
parentNode
==
c
.
rootNode
{
// TODO - test coverage. Currently covered by zipfs/multizip_test.go
parentId
=
raw
.
FUSE_ROOT_ID
}
c
.
fsInit
.
DeleteNotify
(
parentId
,
node
.
nodeId
,
name
)
return
OK
}
...
...
@@ -363,22 +373,27 @@ func (c *FileSystemConnector) EntryNotify(dir *Inode, name string) Status {
}
func
(
c
*
FileSystemConnector
)
DeleteNotify
(
dir
*
Inode
,
child
*
Inode
,
name
string
)
Status
{
dir
.
treeLock
.
RLock
()
n
:=
dir
.
nodeId
var
nId
uint64
var
chId
uint64
dir
.
treeLock
.
RLock
()
if
dir
==
c
.
rootNode
{
nId
=
raw
.
FUSE_ROOT_ID
}
else
{
nId
=
dir
.
nodeId
}
if
child
.
treeLock
!=
dir
.
treeLock
{
child
.
treeLock
.
RLock
()
chId
=
child
.
nodeId
child
.
treeLock
.
RUnlock
()
}
else
{
chId
=
child
.
nodeId
}
dir
.
treeLock
.
RUnlock
()
if
dir
==
c
.
rootNode
{
n
=
raw
.
FUSE_ROOT_ID
}
if
n
==
0
{
if
nId
==
0
{
return
OK
}
return
c
.
fsInit
.
DeleteNotify
(
n
,
chId
,
name
)
return
c
.
fsInit
.
DeleteNotify
(
n
Id
,
chId
,
name
)
}
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