generic: ENOSPC regression test in a multi-threaded scenario
PATCH v2 1/1 generic: ENOSPC regression test in a multi-threaded scenario
Test allocation strategies of the file system and validate space anomalies as reported by the system versus the allocated by the program.
The test is motivated by a bug in ext4 systems where-in ENOSPC is reported by the file system even though enough space for allocations is available[1].
[1]: https://patchwork.ozlabs.org/patch/1294003
Linux kernel patch series that fixes the above regression:53f86b170dfa ("ext4: mballoc: add blocks to PA list under same spinlock
after allocating blocks")cf5e2ca6c990 ("ext4: mballoc: refactor ext4_mb_discard_preallocations()") 07b5b8e1ac40 ("ext4: mballoc: introduce pcpu seqcnt for freeing PA to
improve ENOSPC handling")8ef123fe02ca ("ext4: mballoc: refactor ext4_mb_good_group()") 993778306e79 ("ext4: mballoc: use lock for checking free blocks while
retrying")
---
Changelog:
v1: https://patchwork.kernel.org/patch/11935521
Incorporated the following review comments by Eryu Guan
1. Added references to upstream ext4 bug fix
2. Added entry in .gitignore
3. Explained file ratio argument, along with acceptable ratio format
4. Enabled debug prints by default to go to $seqres.full
5. Added _require_xfs_io_command "falloc" check
6. Removed TEST_DIR require check
7. Described the arguments in calc_thread_cnt and run_testcase
8. Replaced df and bc usage with $DF_PROG and $BC_PROG respectively
9. Fixed -f option to identify fallocate instead of ftruncate
10. Refactored "for" loop format
11. Added comments describing error codes
12. Added and tested the $FTRUNCATE option
13. Dropped stress group and added enospc group
--- .gitignore | 1 + src/Makefile | 2 +- src/t_enospc.c | 193 +++++++++++++++++++++++++++++++++++++++ tests/generic/618 | 207 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/618.out | 2 + tests/generic/group | 1 + 6 files changed, 405 insertions(+), 1 deletion(-) create mode 100644 src/t_enospc.c create mode 100755 tests/generic/618 create mode 100644 tests/generic/618.out
.gitignore +1 -0
@@ -125,6 +125,7 @@ /src/t_dir_offset2 /src/t_dir_type /src/t_encrypted_d_revalidate +/src/t_enospc /src/t_ext4_dax_inline_corruption /src/t_ext4_dax_journal_corruption /src/t_futimens
src/Makefile +1 -1
@@ -17,7 +17,7 @@ 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_get_file_time t_create_short_dirs t_create_long_dirs t_enospc LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
src/t_enospc.c new file +193 -0
193 lines not on this page · raw message
tests/generic/618 new file +207 -0
207 lines not on this page · raw message
tests/generic/618.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 618 +Silence is golden
tests/generic/group +1 -0
@@ -620,3 +620,4 @@ 615 auto rw 616 auto rw io_uring stress 617 auto rw io_uring stress +618 auto rw enospc
Signature · 1 line
2.28.0