generic: mmap and copy file data with page overlapping
authorZorro Lang <zlang@redhat.com>
Fri, 21 May 2021 08:01:45 +0000 (16:01 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 23 May 2021 14:33:57 +0000 (22:33 +0800)
commit8a9bc451112b5e6b62cee9d5630ea8fe7367097d
treed3a86da23aac2d7dd4f39b31457569c10dd6042f
parent466ddbfd11510a1531424b9efc9e167730925644
generic: mmap and copy file data with page overlapping

Mmap 2 pages of file, write 64 bytes to the first and second pages,
copy the data from the first page and then second page to the second
page offset with $pagesize - 64. Verify the data at the end.

       +-----------------------+
       |        (copy)         |
       |                       V
    +---------------+---------------+------------
    |AAAA| ........ |AAAA| ... |AAAA|AAAA|
    +---------------+---------------+------------
                       |            ^
                       |   (copy)   |
                       +------------+

This's also a regression test cover kernel commit: 4f06dd92b5d0
("fuse: fix write deadlock")

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/Makefile
src/t_mmap_writev_overlap.c [new file with mode: 0644]
tests/generic/638 [new file with mode: 0755]
tests/generic/638.out [new file with mode: 0644]
tests/generic/group