Skip to contentSkip to conversation

xfstests: mmap and copy file data with page overlapping

PATCH New Zorro Lang 1 participant 1 message May 21, 2021

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 xfstests: 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")

---
 .gitignore                  |   1 +
 src/Makefile                |   3 +-
 src/t_mmap_writev_overlap.c | 134 ++++++++++++++++++++++++++++++++++++
 tests/generic/637           |  57 +++++++++++++++
 tests/generic/637.out       |   2 +
 tests/generic/group         |   1 +
 6 files changed, 197 insertions(+), 1 deletion(-)
 create mode 100644 src/t_mmap_writev_overlap.c
 create mode 100755 tests/generic/637
 create mode 100644 tests/generic/637.out
.gitignore +1 -0
index 4cc9c807..1e56d7ca 100644
@@ -142,6 +142,7 @@
 /src/t_mmap_stale_pmd
 /src/t_mmap_write_ro
 /src/t_mmap_writev
+/src/t_mmap_writev_overlap
 /src/t_mtab
 /src/t_ofd_locks
 /src/t_open_tmpfiles
src/Makefile +2 -1
index cc0b9579..1279e4b9 100644
@@ -17,7 +17,8 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
 	t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \
 	t_ext4_dax_journal_corruption t_ext4_dax_inline_corruption \
 	t_ofd_locks t_mmap_collision mmap-write-concurrent \
-	t_get_file_time t_create_short_dirs t_create_long_dirs t_enospc
+	t_get_file_time t_create_short_dirs t_create_long_dirs t_enospc \
+	t_mmap_writev_overlap
 
 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
 	preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
src/t_mmap_writev_overlap.c new file +134 -0

134 lines not on this page · raw message

tests/generic/637 new file +57 -0

57 lines not on this page · raw message

tests/generic/637.out new file +2 -0
new file mode 100644
index 00000000..55a3d825
@@ -0,0 +1,2 @@
+QA output created by 637
+Silence is golden
tests/generic/group +1 -0
index 105763c4..b9614c69 100644
@@ -639,3 +639,4 @@
 634 auto quick atime bigtime
 635 auto quick atime bigtime shutdown
 636 auto quick swap
+637 auto quick rw
Signature · 1 line
2.31.1