Files
apfstests/tests/generic/450.out
T
Zorro Lang 4939477f3f generic: test read around EOF
As posix standard, if the file offset is at or past the end of file,
no bytes are read, and read() returns zero. There was a bug, when
DIO read offset is just past the EOF a little, but in the same block
with EOF, read returns different negative values.

Kernel commit 74cedf9b6c60 ("direct-io: Fix negative return from dio
read beyond eof") and commit 2d4594acbf6d ("fix the regression from
"direct-io: Fix negative return from dio read beyond eof"") fixed
the bug.

This case reads from range within EOF, past EOF and at EOF, to make
sure the return value as expected, especially read from past/at EOF
returns 0.

[eguan: update commit log and comments about information of the
specific bug, adjust read_test param order (offset, count, ret) and
test description]

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-08-15 14:37:59 +08:00

12 lines
401 B
Plaintext

QA output created by 450
buffer read the first sector within EOF
buffer read the second block contains EOF
buffer read a sector at (after) EOF
buffer read the last sector past EOF
buffer read at far away from EOF
direct read the first sector within EOF
direct read the second block contains EOF
direct read a sector at (after) EOF
direct read the last sector past EOF
direct read at far away from EOF