generic: add test for DAX MAP_SYNC support
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Thu, 7 Dec 2017 23:19:50 +0000 (16:19 -0700)
committerEryu Guan <eguan@redhat.com>
Sun, 10 Dec 2017 09:46:05 +0000 (17:46 +0800)
commit729b2bc7641c4ad30af071baaa2714d76babd246
tree2012350464204ab5ebbd3ebf9e5fd4b5fe406755
parent1475bdd1f7b6cd434a6e1f8439b2a8a21111942a
generic: add test for DAX MAP_SYNC support

This test creates a file and writes to it via an mmap(), but never
syncs via fsync/msync. This process is tracked via dm-log-writes,
then replayed.

If MAP_SYNC is working the dm-log-writes replay will show the test
file with 1 MiB of on-media block allocations.  This is because each
allocating page fault included an implicit metadata sync.  If
MAP_SYNC isn't working (which you can test by removing the "-S" flag
to xfs_io mmap) the file will be smaller or missing entirely.

Note that dm-log-writes doesn't track the data that we write via the
mmap(), so we can't do any data integrity checking.  We can only
verify that the metadata writes for the page faults happened.

[eguan: add comments on _require_log_writes_dax and fix its cleanup]

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/dmlogwrites
tests/generic/470 [new file with mode: 0755]
tests/generic/470.out [new file with mode: 0644]
tests/generic/group