Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
88a26456
Commit
88a26456
authored
Apr 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cc6c155e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
wcfs/wcfs.go
wcfs/wcfs.go
+6
-1
No files found.
wcfs/wcfs.go
View file @
88a26456
...
@@ -483,6 +483,7 @@ import (
...
@@ -483,6 +483,7 @@ import (
"fmt"
"fmt"
"io"
"io"
stdlog
"log"
stdlog
"log"
"math"
"os"
"os"
"runtime"
"runtime"
"sort"
"sort"
...
@@ -505,6 +506,7 @@ import (
...
@@ -505,6 +506,7 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb/btree"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
_
"lab.nexedi.com/kirr/neo/go/zodb/wks"
_
"lab.nexedi.com/kirr/neo/go/zodb/wks"
"github.com/johncgriffin/overflow"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse/nodefs"
"github.com/hanwen/go-fuse/fuse/nodefs"
"github.com/pkg/errors"
"github.com/pkg/errors"
...
@@ -1155,7 +1157,10 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
...
@@ -1155,7 +1157,10 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
defer
f
.
head
.
zheadMu
.
RUnlock
()
defer
f
.
head
.
zheadMu
.
RUnlock
()
// cap read request to file size
// cap read request to file size
end
:=
off
+
int64
(
len
(
dest
))
// XXX overflow?
end
,
ok
:=
overflow
.
Add64
(
off
,
int64
(
len
(
dest
)))
if
!
ok
{
end
=
math
.
MaxInt64
// cap read request till max possible file size
}
if
end
>
f
.
size
{
if
end
>
f
.
size
{
end
=
f
.
size
end
=
f
.
size
}
}
...
...
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