Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
d205df31
Commit
d205df31
authored
Aug 04, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't return long error responses to ReadDir and ReadFile.
parent
00b92df6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
conversions.go
conversions.go
+14
-4
No files found.
conversions.go
View file @
d205df31
...
@@ -423,14 +423,24 @@ func (c *Connection) kernelResponse(
...
@@ -423,14 +423,24 @@ func (c *Connection) kernelResponse(
h
:=
m
.
OutHeader
()
h
:=
m
.
OutHeader
()
h
.
Unique
=
fuseID
h
.
Unique
=
fuseID
// Did the user return an error? Otherwise, fill in the rest of the response.
// If the user returned the error, fill in the error field of the outgoing
// message header.
if
opErr
!=
nil
{
if
opErr
!=
nil
{
m
.
OutHeader
()
.
Error
=
-
int32
(
syscall
.
EIO
)
if
errno
,
ok
:=
opErr
.
(
syscall
.
Errno
);
ok
{
if
errno
,
ok
:=
opErr
.
(
syscall
.
Errno
);
ok
{
m
.
OutHeader
()
.
Error
=
-
int32
(
errno
)
m
.
OutHeader
()
.
Error
=
-
int32
(
errno
)
}
else
{
m
.
OutHeader
()
.
Error
=
-
int32
(
syscall
.
EIO
)
}
}
}
else
{
// Special case: for some types, convertInMessage grew the message in order
// to obtain a destination buffer. Make sure that we shrink back to just
// the header, because on OS X the kernel otherwise returns EINVAL when we
// attempt to write an error response with a length that extends beyond the
// header.
m
.
Shrink
(
uintptr
(
m
.
Len
()
-
int
(
buffer
.
OutMessageInitialSize
)))
}
// Otherwise, fill in the rest of the response.
if
opErr
==
nil
{
noResponse
=
c
.
kernelResponseForOp
(
m
,
op
)
noResponse
=
c
.
kernelResponseForOp
(
m
,
op
)
}
}
...
...
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