Skip to content

ext4: add lots of KUnit tests!

Theodore Ts'o linux-ext4 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26ext4: add KUinit tests for fs/ext4/extents_status.cfs/ext4/Makefile fs/ext4/extents.c fs/ext4/extents_status-test.c +2 more+1678 -70 replies
2/26ext4: add KUnit tests for fs/ext4/extents.cfs/ext4/ext4_extents.h fs/ext4/ext4_jbd2.c fs/ext4/extents-test.c +5 more+2147 -720 replies
3/26ext4: add KUnit tests for fs/ext4/xattr.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/ialloc.c +9 more+1895 -40 replies
4/26ext4: add KUnit tests for fs/ext4/namei.cfs/ext4/Makefile fs/ext4/crypto.c fs/ext4/dir.c +4 more+2741 -1650 replies
5/26ext4: expand KUnit tests for fs/ext4/mballoc.cfs/ext4/mballoc-test.c fs/ext4/mballoc.c fs/ext4/mballoc.h +1 more+2120 -170 replies
6/26ext4: add KUnit tests for fs/ext4/inline.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/ext4_jbd2.c +3 more+1893 -20 replies
7/26ext4: add KUnit tests for fs/ext4/fast_commit.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/extents_status.c +5 more+2928 -70 replies
8/26ext4: expand KUnit tests for fs/ext4/inode.cfs/ext4/ext4.h fs/ext4/ialloc.c fs/ext4/inode-test.c +3 more+3689 -120 replies
9/26ext4: add KUnit tests for fs/ext4/ialloc.cfs/ext4/Makefile fs/ext4/bitmap.c fs/ext4/ext4.h +5 more+2865 -120 replies
10/26ext4: add KUnit tests for fs/ext4/balloc.cfs/ext4/Makefile fs/ext4/balloc-test.c fs/ext4/balloc.c+2412 -20 replies
11/26ext4: add KUnit tests for fs/ext4/orphan.cfs/ext4/Makefile fs/ext4/inode.c fs/ext4/orphan-test.c +2 more+2381 -10 replies
12/26ext4: add KUnit tests for fs/ext4/block_validity.cfs/ext4/Makefile fs/ext4/block_validity-test.c fs/ext4/block_validity.c+1528 -10 replies
13/26ext4: check multi-block overlap on left traversal in add_system_zone()fs/ext4/block_validity-test.c fs/ext4/block_validity.c+72 -10 replies
14/26ext4: enable full feature coverage in fs/ext4/.kunitconfigfs/ext4/.kunitconfig fs/ext4/balloc-test.c fs/ext4/block_validity-test.c +7 more+121 -170 replies
15/26ext4: add KUnit tests for fs/ext4/super.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/super-test.c +1 more+1610 -10 replies
16/26ext4: add KUnit tests for fs/ext4/sysfs.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/sysfs-test.c +1 more+744 -10 replies
17/26ext4: add KUnit tests for fs/ext4/ioctl.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/ioctl-test.c +1 more+1411 -710 replies
18/26ext4: add KUnit tests for fs/ext4/resize.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/resize-test.c +1 more+1448 -250 replies
19/26ext4: add KUnit tests for fs/ext4/migrate.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/migrate-test.c +1 more+1079 -30 replies
20/26ext4: add KUnit tests for fs/ext4/indirect.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/indirect-test.c +2 more+1321 -40 replies
21/26ext4: expand KUnit tests in fs/ext4/extents-test.c for file range operationsfs/ext4/extents-test.c fs/ext4/extents.c+532 -20 replies
22/26ext4: add KUnit tests for fs/ext4/fsmap.cfs/ext4/Makefile fs/ext4/fsmap-test.c fs/ext4/fsmap.c +1 more+803 -10 replies
23/26ext4: add KUnit tests for fs/ext4/move_extent.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/move_extent-test.c +1 more+1052 -30 replies
24/26ext4: add KUnit tests for fs/ext4/mmp.cfs/ext4/Makefile fs/ext4/ext4.h fs/ext4/mmp-test.c +1 more+770 -300 replies
25/26ext4: add KUnit tests for fs/ext4/dir.cfs/ext4/Makefile fs/ext4/dir-test.c fs/ext4/dir.c +2 more+1040 -10 replies
26/26ext4: add KUnit regression tests for inode migration fixesfs/ext4/ext4_jbd2.c fs/ext4/extents.c fs/ext4/migrate-test.c+334 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH -v2 00/26] ext4: add lots of KUnit tests!

These unit tests were written using the writing-kunit-tests.md prompt[1]. It has received human review, as well as multiple passes with LLM's, especially since the -v1 release.

[1] https://drive.google.com/file/d/1MVZIhlG79kTRX_A65phWiZkTPJEtypsL/view

While the LLM was busily generating these unit tests, it also found around two dozen potential bug fixes[2]. Those will be sent in a separate series.

[2] https://drive.google.com/file/d/1pnTKAVf9pAoCK27619uP4_3_hpE04SkR/view

The patches in this series are available at the ext4.git tree on the branch ext4-kunit-tests[3], which is now based on the ext4.git dev branch[4] (commit 008aad6508e3, on top of v7.4-rc2).

[3] https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/log/?h=ext4-kunit-tests
[4] https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/log/?h=dev

Changes since v1[5]:

- Rebased from v7.3-rc4 onto the ext4.git dev branch (on top of v7.4-rc2), updating test stubs, teardown helpers, and expectations for upstream and dev changes (ext4_es_destroy_stats(), const struct mnt_idmap *, buffer_write_io_error(), handle_t * zeroout arguments, blkdev_issue_flush() error propagation, sb_find_get_block() inode bitmap lookups, the 2 MiB max orphan file size, flex_bg sibling directory spreading, and stopping cleanly on incomplete fast commit replay).
- Dropped "ext4: zero s_fc_replay_state in ext4_fc_replay_cleanup()", superseded by commit 2d36dbdbf575 ("ext4: free fast commit replay state on failed mounts") in dev.
- Squashed "ext4: add KUnit tests for ext4_ext_split() leaf and index splitting" into "ext4: add KUnit tests for fs/ext4/extents.c".
- Added "ext4: add KUnit regression tests for inode migration fixes" covering the ext4_ext_migrate() fixes now in dev.
- Addressed build, sparse, bisection, portability, and test-lifecycle issues reported by the kernel test robot and sashiko-bot, along with follow-up verification fixes across UML, x86_64, i386, arm, and arm64 (including 16K/64K pages, lockdep, KASAN, sparse C=2, and per-commit CONFIG_EXT4_KUNIT_TESTS=m builds):
* Deduplicated and reordered EXPORT_SYMBOL_FOR_EXT4_TEST() exports, dropped unused mballoc test wrappers, and moved the SB_ENC_STRICT_MODE_FL fix into the namei test patch for clean modular and CONFIG_UNICODE=y bisection.
* Fixed 32-bit 64-bit-division link errors (div_u64/div_u64_rem), big-endian EXT4_EXT_MAGIC checks, sparse warnings (__le16/__le32, __percpu, __bitwise, flexible-array structs, upper_32_bits()), unaligned bitmap word ops, and large stack frames in tests.
* Fixed mock superblock and inode teardown (attaching s_root via d_make_root() so deactivate_super() drains fserror_worker(), moving ext4_es_remove_extent() from .free_inode to .evict_inode, draining RCU callbacks via rcu_barrier(), and registering KUnit cleanup actions for early-abort safety).
* Fixed lockdep key initialization, i_size_ordered_init() on mock inodes, CONFIG_HIGHMEM folio copies, 16K/64K PAGE_SIZE block and buddy-group spacing, SMP/preemption test races, RTC-less i_dtime checks, and !CONFIG_QUOTA / !CONFIG_PRINTK handling.

[5] https://lore.kernel.org/r/[email protected]

Theodore Ts'o (26):
ext4: add KUinit tests for fs/ext4/extents_status.c
ext4: add KUnit tests for fs/ext4/extents.c
ext4: add KUnit tests for fs/ext4/xattr.c
ext4: add KUnit tests for fs/ext4/namei.c
ext4: expand KUnit tests for fs/ext4/mballoc.c
ext4: add KUnit tests for fs/ext4/inline.c
ext4: add KUnit tests for fs/ext4/fast_commit.c
ext4: expand KUnit tests for fs/ext4/inode.c
ext4: add KUnit tests for fs/ext4/ialloc.c
ext4: add KUnit tests for fs/ext4/balloc.c
ext4: add KUnit tests for fs/ext4/orphan.c
ext4: add KUnit tests for fs/ext4/block_validity.c
ext4: check multi-block overlap on left traversal in add_system_zone()
ext4: enable full feature coverage in fs/ext4/.kunitconfig
ext4: add KUnit tests for fs/ext4/super.c
ext4: add KUnit tests for fs/ext4/sysfs.c
ext4: add KUnit tests for fs/ext4/ioctl.c
ext4: add KUnit tests for fs/ext4/resize.c
ext4: add KUnit tests for fs/ext4/migrate.c
ext4: add KUnit tests for fs/ext4/indirect.c
ext4: expand KUnit tests in fs/ext4/extents-test.c for file range
operations
ext4: add KUnit tests for fs/ext4/fsmap.c
ext4: add KUnit tests for fs/ext4/move_extent.c
ext4: add KUnit tests for fs/ext4/mmp.c
ext4: add KUnit tests for fs/ext4/dir.c
ext4: add KUnit regression tests for inode migration fixes

 fs/ext4/.kunitconfig          |    7 +
 fs/ext4/Makefile              |   12 +-
 fs/ext4/balloc-test.c         | 2403 ++++++++++++++++++++++
 fs/ext4/balloc.c              |   11 +-
 fs/ext4/bitmap.c              |    5 +
 fs/ext4/block_validity-test.c | 1598 +++++++++++++++
 fs/ext4/block_validity.c      |   11 +-
 fs/ext4/crypto.c              |    4 +
 fs/ext4/dir-test.c            |  993 ++++++++++
 fs/ext4/dir.c                 |   37 +
 fs/ext4/ext4.h                |  255 ++-
 fs/ext4/ext4_extents.h        |   21 +
 fs/ext4/ext4_jbd2.c           |   21 +
 fs/ext4/extents-test.c        | 2625 +++++++++++++++++++++++-
 fs/ext4/extents.c             |   99 +-
 fs/ext4/extents_status-test.c | 1646 ++++++++++++++++
 fs/ext4/extents_status.c      |   23 +
 fs/ext4/fast_commit-test.c    | 2714 +++++++++++++++++++++++++
 fs/ext4/fast_commit.c         |  180 +-
 fs/ext4/fsmap-test.c          |  796 ++++++++
 fs/ext4/fsmap.c               |    3 +
 fs/ext4/ialloc-test.c         | 2731 +++++++++++++++++++++++++
 fs/ext4/ialloc.c              |  104 +-
 fs/ext4/indirect-test.c       | 1293 ++++++++++++
 fs/ext4/indirect.c            |   18 +-
 fs/ext4/inline-test.c         | 1866 ++++++++++++++++++
 fs/ext4/inline.c              |   34 +-
 fs/ext4/inode-test.c          | 3511 ++++++++++++++++++++++++++++++++-
 fs/ext4/inode.c               |  192 +-
 fs/ext4/ioctl-test.c          | 1198 +++++++++++
 fs/ext4/ioctl.c               |  249 ++-
 fs/ext4/mballoc-test.c        | 1940 +++++++++++++++++-
 fs/ext4/mballoc.c             |  181 +-
 fs/ext4/mballoc.h             |   40 +
 fs/ext4/migrate-test.c        | 1384 +++++++++++++
 fs/ext4/migrate.c             |   11 +
 fs/ext4/mmp-test.c            |  661 +++++++
 fs/ext4/mmp.c                 |  117 +-
 fs/ext4/move_extent-test.c    | 1023 ++++++++++
 fs/ext4/move_extent.c         |   22 +
 fs/ext4/namei-test.c          | 2347 ++++++++++++++++++++++
 fs/ext4/namei.c               |  342 ++--
 fs/ext4/namei.h               |  213 ++
 fs/ext4/orphan-test.c         | 2372 ++++++++++++++++++++++
 fs/ext4/orphan.c              |   12 +
 fs/ext4/page-io.c             |    1 +
 fs/ext4/resize-test.c         | 1336 +++++++++++++
 fs/ext4/resize.c              |  102 +-
 fs/ext4/super-test.c          | 1345 +++++++++++++
 fs/ext4/super.c               |  276 ++-
 fs/ext4/sysfs-test.c          |  679 +++++++
 fs/ext4/sysfs.c               |   55 +
 fs/ext4/xattr-test.c          | 1822 +++++++++++++++++
 fs/ext4/xattr.c               |   30 +-
 fs/ext4/xattr.h               |    2 +
 fs/ext4/xattr_hurd.c          |    4 +
 fs/ext4/xattr_security.c      |    4 +
 fs/ext4/xattr_trusted.c       |    4 +
 fs/ext4/xattr_user.c          |    4 +
 59 files changed, 40569 insertions(+), 420 deletions(-)
 create mode 100644 fs/ext4/balloc-test.c
 create mode 100644 fs/ext4/block_validity-test.c
 create mode 100644 fs/ext4/dir-test.c
 create mode 100644 fs/ext4/extents_status-test.c
 create mode 100644 fs/ext4/fast_commit-test.c
 create mode 100644 fs/ext4/fsmap-test.c
 create mode 100644 fs/ext4/ialloc-test.c
 create mode 100644 fs/ext4/indirect-test.c
 create mode 100644 fs/ext4/inline-test.c
 create mode 100644 fs/ext4/ioctl-test.c
 create mode 100644 fs/ext4/migrate-test.c
 create mode 100644 fs/ext4/mmp-test.c
 create mode 100644 fs/ext4/move_extent-test.c
 create mode 100644 fs/ext4/namei-test.c
 create mode 100644 fs/ext4/namei.h
 create mode 100644 fs/ext4/orphan-test.c
 create mode 100644 fs/ext4/resize-test.c
 create mode 100644 fs/ext4/super-test.c
 create mode 100644 fs/ext4/sysfs-test.c
 create mode 100644 fs/ext4/xattr-test.c

base-commit: 008aad6508e30cd1bb6d2c2cf65221ba1f16a065

Signature · 1 line
2.56.1.708.g77570a6a1d-goog