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
5f46e065
Commit
5f46e065
authored
Jul 29, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Unmount issue notify.
Drop sleep statements for unmount tests.
parent
7b7b45dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
24 deletions
+24
-24
fuse/mount.go
fuse/mount.go
+19
-14
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+5
-0
unionfs/autounion_test.go
unionfs/autounion_test.go
+0
-5
zipfs/multizip_test.go
zipfs/multizip_test.go
+0
-5
No files found.
fuse/mount.go
View file @
5f46e065
...
...
@@ -85,23 +85,28 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin
return
}
func
unmount
(
mountPoint
string
)
(
err
os
.
Error
)
{
if
os
.
Geteuid
()
==
0
{
maxTry
:=
2
delay
:=
int64
(
0
)
errNo
:=
0
func
privilegedUnmount
(
mountPoint
string
)
os
.
Error
{
maxTry
:=
2
delay
:=
int64
(
0
)
errNo
:=
syscall
.
Unmount
(
mountPoint
,
0
)
for
try
:=
0
;
errNo
!=
0
&&
try
<
maxTry
;
try
++
{
// A file close operation must be processed and acked
// by the daemon. This takes some time, so retry if
// the first unmount fails.
for
try
:=
0
;
try
<
maxTry
;
try
++
{
errNo
=
syscall
.
Unmount
(
mountPoint
,
0
)
if
errNo
==
0
{
return
nil
}
delay
=
2
*
delay
+
0.01e9
time
.
Sleep
(
delay
)
}
return
os
.
Errno
(
errNo
)
delay
=
2
*
delay
+
0.01e9
time
.
Sleep
(
delay
)
errNo
=
syscall
.
Unmount
(
mountPoint
,
0
)
}
if
errNo
==
0
{
return
nil
}
return
os
.
Errno
(
errNo
)
}
func
unmount
(
mountPoint
string
)
(
err
os
.
Error
)
{
if
os
.
Geteuid
()
==
0
{
return
privilegedUnmount
(
mountPoint
)
}
dir
,
_
:=
filepath
.
Split
(
mountPoint
)
proc
,
err
:=
os
.
StartProcess
(
mountBinary
,
...
...
fuse/pathfilesystem.go
View file @
5f46e065
...
...
@@ -593,6 +593,11 @@ func (me *FileSystemConnector) Unmount(path string) Status {
}
me
.
unsafeUnmountNode
(
node
)
notifyMessage
:=
NotifyInvalInodeOut
{
Ino
:
node
.
NodeId
,
}
me
.
fsInit
.
InodeNotify
(
&
notifyMessage
)
return
OK
}
...
...
unionfs/autounion_test.go
View file @
5f46e065
...
...
@@ -7,7 +7,6 @@ import (
"fmt"
"log"
"testing"
"time"
)
var
_
=
fmt
.
Print
...
...
@@ -93,10 +92,6 @@ func TestAutoFsSymlink(t *testing.T) {
err
=
os
.
Remove
(
wd
+
"/mount/config/manual1"
)
CheckSuccess
(
err
)
// Need time for the unmount to be noticed.
log
.
Println
(
"sleeping..."
)
time
.
Sleep
(
2
*
entryTtl
*
1e9
)
scan
:=
wd
+
"/mount/config/"
+
_SCAN_CONFIG
err
=
ioutil
.
WriteFile
(
scan
,
[]
byte
(
"something"
),
0644
)
if
err
!=
nil
{
...
...
zipfs/multizip_test.go
View file @
5f46e065
...
...
@@ -6,7 +6,6 @@ import (
"log"
"os"
"testing"
"time"
)
var
_
=
log
.
Printf
...
...
@@ -92,10 +91,6 @@ func TestMultiZipFs(t *testing.T) {
err
=
os
.
Remove
(
mountPoint
+
"/config/zipmount"
)
CheckSuccess
(
err
)
// This is ugly but necessary: We don't have ways to signal
// back to FUSE that the file disappeared.
time
.
Sleep
(
1.5e9
*
testTtl
)
fi
,
err
=
os
.
Stat
(
mountPoint
+
"/zipmount"
)
if
err
==
nil
{
t
.
Error
(
"stat should fail after unmount."
,
fi
)
...
...
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