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
d5a1bca6
Commit
d5a1bca6
authored
Mar 06, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: close dirstream on Releasedir
parent
1002f0a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
nodefs/api.go
nodefs/api.go
+1
-1
nodefs/bridge.go
nodefs/bridge.go
+6
-4
No files found.
nodefs/api.go
View file @
d5a1bca6
...
...
@@ -75,7 +75,7 @@ type DirStream interface {
Next
()
(
fuse
.
DirEntry
,
fuse
.
Status
)
// Close releases resources related to this directory
// stream.
A stream should be resilient against double close.
// stream.
Close
()
}
...
...
nodefs/bridge.go
View file @
d5a1bca6
...
...
@@ -492,6 +492,11 @@ func (b *rawBridge) Release(input *fuse.ReleaseIn) {
}
func
(
b
*
rawBridge
)
ReleaseDir
(
input
*
fuse
.
ReleaseIn
)
{
_
,
f
:=
b
.
inode
(
input
.
NodeId
,
input
.
Fh
)
if
f
.
dirStream
!=
nil
{
f
.
dirStream
.
Close
()
}
b
.
releaseFileEntry
(
input
.
Fh
)
}
...
...
@@ -540,6 +545,7 @@ func (b *rawBridge) getStream(input *fuse.ReadIn, inode *Inode, f *fileEntry) fu
if
f
.
dirStream
==
nil
||
input
.
Offset
==
0
{
if
f
.
dirStream
!=
nil
{
f
.
dirStream
.
Close
()
f
.
dirStream
=
nil
}
str
,
code
:=
inode
.
node
.
ReadDir
(
context
.
TODO
())
if
!
code
.
Ok
()
{
...
...
@@ -571,7 +577,6 @@ func (b *rawBridge) ReadDir(input *fuse.ReadIn, out *fuse.DirEntryList) fuse.Sta
e
,
code
:=
f
.
dirStream
.
Next
()
if
!
code
.
Ok
()
{
f
.
dirStream
.
Close
()
return
code
}
if
!
out
.
AddDirEntry
(
e
)
{
...
...
@@ -581,7 +586,6 @@ func (b *rawBridge) ReadDir(input *fuse.ReadIn, out *fuse.DirEntryList) fuse.Sta
}
}
f
.
dirStream
.
Close
()
return
fuse
.
OK
}
...
...
@@ -609,7 +613,6 @@ func (b *rawBridge) ReadDirPlus(input *fuse.ReadIn, out *fuse.DirEntryList) fuse
}
if
!
code
.
Ok
()
{
f
.
dirStream
.
Close
()
return
code
}
...
...
@@ -637,7 +640,6 @@ func (b *rawBridge) ReadDirPlus(input *fuse.ReadIn, out *fuse.DirEntryList) fuse
}
}
f
.
dirStream
.
Close
()
return
fuse
.
OK
}
...
...
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