Commit aae77bfe authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3160dc48
......@@ -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
}
......
......@@ -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'})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment