generic: test DAX DMA vs truncate/hole-punch
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Fri, 27 Jul 2018 21:12:52 +0000 (15:12 -0600)
committerEryu Guan <guaneryu@gmail.com>
Sun, 29 Jul 2018 05:43:57 +0000 (13:43 +0800)
commitd2f9bf265f1473e388a706159907c9866930e1da
treeb1f5e12f85aa9603fa7d4d7060ee7a422f819b56
parent6eab1aafe25972daeb733197b4b39e7818c88616
generic: test DAX DMA vs truncate/hole-punch

This adds a regression test for the following series:

[PATCH v4 0/2] ext4: fix DAX dma vs truncate/hole-punch
https://lists.01.org/pipermail/linux-nvdimm/2018-July/016842.html

which adds synchronization between DAX DMA in ext4 and truncate/hole-punch.
The intention of the test is to test those specific changes, but it runs
fine both with XFS and without DAX so I've put it in the generic tests
instead of ext4 and not restricted it to only DAX configurations.

When run with v4.18-rc6 + DAX + ext4, this test will hit the following
WARN_ON_ONCE() in dax_disassociate_entry():

WARN_ON_ONCE(trunc && page_ref_count(page) > 1);

If you change this to a WARN_ON() instead, you can see that each of the
four paths being exercised in this test hits that condition many times in
the one second that the subtest is being run.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/Makefile
src/t_mmap_collision.c [new file with mode: 0644]
tests/generic/503 [new file with mode: 0755]
tests/generic/503.out [new file with mode: 0644]
tests/generic/group