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
dcd86912
Commit
dcd86912
authored
Aug 11, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go runtime raises Double panic. Looks like I feel data structures wrong.
parent
2c9c730e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
fuse/fuse.go
fuse/fuse.go
+16
-0
No files found.
fuse/fuse.go
View file @
dcd86912
...
@@ -25,9 +25,11 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
...
@@ -25,9 +25,11 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
defer
local
.
Close
()
defer
local
.
Close
()
defer
remote
.
Close
()
defer
remote
.
Close
()
fmt
.
Printf
(
"Mount: 20
\n
"
)
mountPoint
=
path
.
Clean
(
mountPoint
)
mountPoint
=
path
.
Clean
(
mountPoint
)
if
!
path
.
Rooted
(
mountPoint
)
{
if
!
path
.
Rooted
(
mountPoint
)
{
cwd
,
err
:=
os
.
Getwd
()
cwd
,
err
:=
os
.
Getwd
()
...
@@ -36,6 +38,7 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
...
@@ -36,6 +38,7 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
}
}
mountPoint
=
path
.
Clean
(
path
.
Join
(
cwd
,
mountPoint
))
mountPoint
=
path
.
Clean
(
path
.
Join
(
cwd
,
mountPoint
))
}
}
fmt
.
Printf
(
"Mount: 40
\n
"
)
pid
,
err
:=
os
.
ForkExec
(
"/bin/fusermount"
,
pid
,
err
:=
os
.
ForkExec
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
mountPoint
},
[]
string
{
"/bin/fusermount"
,
mountPoint
},
[]
string
{
"_FUSE_COMMFD=3"
},
[]
string
{
"_FUSE_COMMFD=3"
},
...
@@ -51,15 +54,21 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
...
@@ -51,15 +54,21 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
if
w
.
ExitStatus
()
!=
0
{
if
w
.
ExitStatus
()
!=
0
{
return
nil
,
os
.
NewError
(
fmt
.
Sprintf
(
"fusermount exited with code %d
\n
"
,
w
.
ExitStatus
()))
return
nil
,
os
.
NewError
(
fmt
.
Sprintf
(
"fusermount exited with code %d
\n
"
,
w
.
ExitStatus
()))
}
}
fmt
.
Printf
(
"Mount: 100
\n
"
)
f
,
err
:=
getFuseConn
(
local
)
f
,
err
:=
getFuseConn
(
local
)
fmt
.
Printf
(
"Mount: 110
\n
"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
m
=
&
MountPoint
{
mountPoint
,
f
}
m
=
&
MountPoint
{
mountPoint
,
f
}
fmt
.
Printf
(
"I'm here!!
\n
"
)
return
return
}
}
func
(
m
*
MountPoint
)
Unmount
()
(
err
os
.
Error
)
{
func
(
m
*
MountPoint
)
Unmount
()
(
err
os
.
Error
)
{
if
m
==
nil
{
return
nil
}
pid
,
err
:=
os
.
ForkExec
(
"/bin/fusermount"
,
pid
,
err
:=
os
.
ForkExec
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
"-u"
,
"m"
,
m
.
mountPoint
},
[]
string
{
"/bin/fusermount"
,
"-u"
,
"m"
,
m
.
mountPoint
},
nil
,
nil
,
...
@@ -87,7 +96,9 @@ func recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, errno int) {
...
@@ -87,7 +96,9 @@ func recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, errno int) {
}
}
func
Recvmsg
(
fd
int
,
msg
*
syscall
.
Msghdr
,
flags
int
)
(
n
int
,
err
os
.
Error
)
{
func
Recvmsg
(
fd
int
,
msg
*
syscall
.
Msghdr
,
flags
int
)
(
n
int
,
err
os
.
Error
)
{
fmt
.
Printf
(
"Recvmsg, 0
\n
"
)
n
,
errno
:=
recvmsg
(
fd
,
msg
,
flags
)
n
,
errno
:=
recvmsg
(
fd
,
msg
,
flags
)
fmt
.
Printf
(
"Recvmsg, 10
\n
"
)
if
errno
!=
0
{
if
errno
!=
0
{
err
=
os
.
NewSyscallError
(
"recvmsg"
,
errno
)
err
=
os
.
NewSyscallError
(
"recvmsg"
,
errno
)
}
}
...
@@ -108,13 +119,17 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
...
@@ -108,13 +119,17 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
msg
.
Controllen
=
uint64
(
len
(
control
)
*
4
)
msg
.
Controllen
=
uint64
(
len
(
control
)
*
4
)
_
,
err
=
Recvmsg
(
local
.
File
()
.
Fd
(),
&
msg
,
0
)
_
,
err
=
Recvmsg
(
local
.
File
()
.
Fd
(),
&
msg
,
0
)
fmt
.
Printf
(
"getFuseConn: 100
\n
"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
fmt
.
Printf
(
"getFuseConn: 110
\n
"
)
length
:=
control
[
0
]
length
:=
control
[
0
]
fmt
.
Printf
(
"getFuseConn: 120
\n
"
)
typ
:=
control
[
2
]
// syscall.Cmsghdr.Type
typ
:=
control
[
2
]
// syscall.Cmsghdr.Type
fd
:=
control
[
4
]
fd
:=
control
[
4
]
fmt
.
Printf
(
"getFuseConn: 130
\n
"
)
if
typ
!=
1
{
if
typ
!=
1
{
err
=
os
.
NewError
(
fmt
.
Sprintf
(
"getFuseConn: recvmsg returned wrong control type: %d"
,
typ
))
err
=
os
.
NewError
(
fmt
.
Sprintf
(
"getFuseConn: recvmsg returned wrong control type: %d"
,
typ
))
return
return
...
@@ -129,6 +144,7 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
...
@@ -129,6 +144,7 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
return
return
}
}
fmt
.
Printf
(
"getFuseConn: 180
\n
"
)
f
=
os
.
NewFile
(
int
(
fd
),
"fuse-conn"
)
f
=
os
.
NewFile
(
int
(
fd
),
"fuse-conn"
)
return
return
}
}
...
...
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