generic: test pagecache invalidation after direct write
authorEryu Guan <eguan@redhat.com>
Fri, 10 Mar 2017 09:27:38 +0000 (17:27 +0800)
committerEryu Guan <eguan@redhat.com>
Wed, 22 Mar 2017 03:29:23 +0000 (11:29 +0800)
commit9953b149b5e11d5ba315f85b91cd71b030edc78c
tree903e6679b8e4e7f74b2130e97e5fee0e13a3a2ea
parent780dd1eaffaf57ff6910289bd74d82a884677c3c
generic: test pagecache invalidation after direct write

Test if direct write invalidates pagecache correctly, so that
subsequent buffer read reads the correct data from disk.

This test is inspired by LTP tests dio29, and serves as a regression
test for the bug found by it, see kernel commit c771c14baa33
("iomap: invalidate page caches should be after iomap_dio_complete()
in direct write").

The test can be easily expanded to other write/read combinations,
e.g.  buffer write + direct read and direct write + direct read, so
they are also being tested.

Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
.gitignore
src/Makefile
src/dio-invalidate-cache.c [new file with mode: 0644]
tests/generic/418 [new file with mode: 0755]
tests/generic/418.out [new file with mode: 0644]
tests/generic/group