generic: add regression test for stale mmap reads

This adds a regression test for the following kernel patch:

  dax: fix data corruption due to stale mmap reads

The above patch fixes an issue where users of DAX can suffer data
corruption from stale mmap reads via the following sequence:

- open an mmap over a 2MiB hole

- read from a 2MiB hole, faulting in a 2MiB zero page

- write to the hole with write(3p).  The write succeeds but we incorrectly
  leave the 2MiB zero page mapping intact.

- via the mmap, read the data that was just written.  Since the zero page
  mapping is still intact we read back zeroes instead of the new data.

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>
This commit is contained in:
Ross Zwisler
2017-04-26 12:05:31 -06:00
committed by Eryu Guan
parent accf20216c
commit bba1b1b2b9
6 changed files with 138 additions and 1 deletions
+1
View File
@@ -147,6 +147,7 @@
/src/renameat2
/src/t_rename_overwrite
/src/t_mmap_dio
/src/t_mmap_stale_pmd
# dmapi/ binaries
/dmapi/src/common/cmd/read_invis