ext4: test for DAX + journaling corruption
PATCH 1/2 ext4: test for DAX + journaling corruption
Add a regression test for the following kernel commit:
ext4: prevent data corruption with journaling + DAX
The test passes if either we successfully compare the data between the mmap with journaling turned on and the one with journaling turned off, or if we fail the chattr command to turn on or off journaling. The latter is how we prevent this issue in the kernel.
---
Changes since v1:
- Reordered .gitignore entry. (Eryu)
- Added comments about how "chattr +j" turns off DAX and about why we need the 'nodelalloc' mount option. (Eryu)
- Added a _require_command for chattr. (Eryu)
- Added $here for src/t_ext4_dax_journal_corruption command. (Eryu)
The previous version of this series is here:
https://lists.01.org/pipermail/linux-nvdimm/2017-September/012463.html
The related kernel patches were merged in v4.15-rc1.
--- .gitignore | 1 + src/Makefile | 3 +- src/t_ext4_dax_journal_corruption.c | 102 ++++++++++++++++++++++++++++++++++++ tests/ext4/030 | 74 ++++++++++++++++++++++++++ tests/ext4/030.out | 2 + tests/ext4/group | 1 + 6 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 src/t_ext4_dax_journal_corruption.c create mode 100755 tests/ext4/030 create mode 100644 tests/ext4/030.out
.gitignore +1 -0
@@ -115,6 +115,7 @@ /src/t_dir_offset2 /src/t_dir_type /src/t_encrypted_d_revalidate +/src/t_ext4_dax_journal_corruption /src/t_futimens /src/t_getcwd /src/t_holes
src/Makefile +2 -1
@@ -13,7 +13,8 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \ multi_open_unlink dmiperf unwritten_sync genhashnames t_holes \ t_mmap_writev t_truncate_cmtime dirhash_collide t_rename_overwrite \ holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \ - t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro + t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \ + t_ext4_dax_journal_corruption LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
src/t_ext4_dax_journal_corruption.c new file +102 -0
102 lines not on this page · raw message
tests/ext4/030 new file +74 -0
74 lines not on this page · raw message
tests/ext4/030.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 030 +Silence is golden
tests/ext4/group +1 -0
@@ -32,6 +32,7 @@ 027 auto quick fsmap 028 auto quick fsmap 029 auto quick fsmap +030 auto quick 271 auto rw quick 301 aio auto ioctl rw stress defrag 302 aio auto ioctl rw stress defrag
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH 2/2 ext4: test for inline data + DAX corruption
Add a regression test for the following kernel commit:
ext4: prevent data corruption with inline data + DAX
The test passes either if we don't encounter corruption, or if mounting with DAX + inline data fails. The latter is the way that we prevent this issue in the kernel.
---
Changes since v1:
- Changed ordering of .gitignore entries. (Eryu)
- Added '_require_scratch_ext4_feature "inline_data"' test. (Eryu)
--- .gitignore | 1 + src/Makefile | 2 +- src/t_ext4_dax_inline_corruption.c | 70 +++++++++++++++++++++++++++++++ tests/ext4/031 | 86 ++++++++++++++++++++++++++++++++++++++ tests/ext4/031.out | 2 + tests/ext4/group | 1 + 6 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 src/t_ext4_dax_inline_corruption.c create mode 100755 tests/ext4/031 create mode 100644 tests/ext4/031.out
.gitignore +1 -0
@@ -116,6 +116,7 @@ /src/t_dir_type /src/t_encrypted_d_revalidate /src/t_ext4_dax_journal_corruption +/src/t_ext4_dax_inline_corruption /src/t_futimens /src/t_getcwd /src/t_holes
src/Makefile +1 -1
@@ -14,7 +14,7 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \ t_mmap_writev t_truncate_cmtime dirhash_collide t_rename_overwrite \ holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \ t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \ - t_ext4_dax_journal_corruption + t_ext4_dax_journal_corruption t_ext4_dax_inline_corruption LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
src/t_ext4_dax_inline_corruption.c new file +70 -0
70 lines not on this page · raw message
tests/ext4/031 new file +86 -0
86 lines not on this page · raw message
tests/ext4/031.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 031 +Silence is golden
tests/ext4/group +1 -0
@@ -33,6 +33,7 @@ 028 auto quick fsmap 029 auto quick fsmap 030 auto quick +031 auto quick 271 auto rw quick 301 aio auto ioctl rw stress defrag 302 aio auto ioctl rw stress defrag
Signature · 6 lines
2.14.3 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm