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
aae77bfe
Commit
aae77bfe
authored
Jul 01, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3160dc48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
wcfs/wcfs.go
wcfs/wcfs.go
+2
-1
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+5
-1
No files found.
wcfs/wcfs.go
View file @
aae77bfe
...
...
@@ -1062,7 +1062,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
end
=
f
.
size
}
if
end
<=
off
{
// XXX off >= size -> EINVAL? (but when size=0 kernel issues e.g. [0 +4K) read)
// the kernel issues e.g. [0 +4K) read for f.size=0 and expects to get (0, ok)
// POSIX also says to return 0 if off >= f.size
return
fuse
.
ReadResultData
(
nil
),
fuse
.
OK
}
...
...
wcfs/wcfs_test.py
View file @
aae77bfe
...
...
@@ -44,7 +44,7 @@ from zodbtools.util import ashex as h, fromhex
import
pytest
;
xfail
=
pytest
.
mark
.
xfail
from
pytest
import
raises
,
fail
from
six
import
reraise
from
.internal
import
mm
from
.internal
import
io
,
mm
from
.internal.wcfs_test
import
read_nogil
,
install_sigbus_trap
,
fadvise_dontneed
# setup:
...
...
@@ -1248,6 +1248,10 @@ def test_wcfs_basic():
f
.
assertCache
([
0
,
0
,
0
])
# initially not cached
f
.
assertData
([
''
,
''
,
'c1'
],
mtime
=
t
.
head
)
# read after file size returns (0, ok)
# (the same behaviour as on e.g. ext4 and as requested by posix)
assert
0
==
io
.
readat
(
f
.
f
.
fileno
(),
100
*
blksize
,
bytearray
(
10
))
# >>> (@at2) commit again -> we can see both latest and snapshotted states
# NOTE blocks d(4) and f(5) will be accessed only in the end
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
,
3
:
'd2'
,
5
:
'f2'
})
...
...
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