Linux/linux 4dce97c — fs/ext4 orphan-test.c balloc-test.c

Merge tag 'ext4_for_linus-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 updates from Ted Ts'o:
 "The bulk of the new lines was caused by adding KUnit tests, which
  makes it safer to validate AI generated patches.

  Three minor performance provements:

   - Spread the inodes of files in sibling directories over the block
     groups of a flex group. This avoids contention on the inode table
     buffer locks and significantly speeds up parallel file creation

   - Move the orphan list tracking fields in ext4_sb_info off the cache
     line shared with the journal state, which improves unlink
     performance on file systems without the orphan_file feature

   - Speed up fast commit replay for sparse files by skipping holes when
     shrinking the extent tree.


    [83 lines not shown]
DeltaFile
+3,504-4fs/ext4/inode-test.c
+2,731-0fs/ext4/ialloc-test.c
+2,714-0fs/ext4/fast_commit-test.c
+2,563-72fs/ext4/extents-test.c
+2,403-0fs/ext4/balloc-test.c
+2,372-0fs/ext4/orphan-test.c
+16,287-7662 files not shown
+41,204-62168 files

Linux/linux 4ca7b0f — scripts Makefile.warn Makefile.autofdo

Merge tag 'kbuild-fixes-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux

Pull Kbuild fixes from Nathan Chancellor:

 - Move GCC 17's implementation of -Wconstant-logical-operand to W=2
   to fix builds with -Werror

 - Disable LLVM's flow-based profile inference algorithm (Profi) for
   AutoFDO, which can degrade runtime performance and cause pathological
   compilation time issues

* tag 'kbuild-fixes-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
  kbuild: AutoFDO: Disable Profi (-fno-sample-profile-use-profi)
  kbuild: move gcc's -Wconstant-logical-operand to W=2
DeltaFile
+3-0scripts/Makefile.autofdo
+3-0scripts/Kconfig.toolchain
+1-0scripts/Makefile.warn
+7-03 files

Linux/linux 8bdd5fa — fs eventpoll.c, fs/orangefs orangefs-bufmap.c

sched/wait: remove the __add_wait_queue_*exclusive() helpers

Each has one or two special-case users.  Open-code them there: set
WQ_FLAG_EXCLUSIVE and queue the entry directly, with a note on why the
caller doesn't use add_wait_queue_exclusive().

I think all cases (eventpoll, orangefs and ubifs) are unnecessary and
could just use the regular ordering, but I'll leave that to those
maintainers to sort out.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Cc: Alexander Viro <viro at zeniv.linux.org.uk>    # eventpoll
Cc: Christian Brauner <brauner at kernel.org>      # eventpoll
Cc: Jan Kara <jack at suse.cz>                     # eventpoll
Cc: Mike Marshall <hubcap at omnibond.com>         # orangefs

    [2 lines not shown]
DeltaFile
+0-17include/linux/wait.h
+5-2fs/orangefs/orangefs-bufmap.c
+5-2fs/eventpoll.c
+3-1fs/ubifs/journal.c
+13-224 files

Linux/linux 4705d36 — block blk-iocost.c, drivers/gpu/drm/i915 i915_sw_fence.c

sched/wait: remove __add_wait_queue_entry_tail()

__add_wait_queue() and __add_wait_queue_entry_tail() are now the same.

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+4-4kernel/sched/wait.c
+1-6include/linux/wait.h
+3-3mm/filemap.c
+1-1fs/orangefs/orangefs-bufmap.c
+1-1drivers/gpu/drm/i915/i915_sw_fence.c
+1-1block/blk-iocost.c
+11-161 files not shown
+12-177 files

Linux/linux 8ac5525 — include/linux wait.h, kernel/sched wait.c

sched/wait: always queue new waiters at the tail

Non-exclusive waiters have been added at the head and exclusive ones at
the tail, so that an exclusive wakeup stopping early still woke every
non-exclusive waiter.

That only matters for waiters that mix both kinds on one queue like
read() and poll() on a pipe - and even then it doesn't actually buy
anything but complexity and fragility of the code.

An exclusive reader consumes the event, the poller had nothing to see,
so there's no real point in keeping the two ordered.

The pointless ordering results in a special rule for everybody adding
themselves to the wait queue, and that rule has not been consistently
followed anyway (see for example do_wait_intr() and do_wait_intr_irq())

So just queue everyone in FIFO order.  LIFO might be better for
throughput, but every time we've ever tried that optimization in real

    [22 lines not shown]
DeltaFile
+16-13kernel/sched/wait.c
+3-11include/linux/wait.h
+19-242 files

Linux/linux 8307892 — io_uring poll.c

io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE

Same problem as epoll: an EPOLLEXCLUSIVE poll request returns 1 from
io_poll_wake() (even when it lost the ownership race and does nothing),
which stops the wakeup walk, but posting a CQE doesn't consume the
event.

Waiters queued behind it can sleep with the event pending.

Use WQ_FLAG_POLL_EXCLUSIVE, so only one io_uring entry is woken but real
waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Jens Axboe <axboe at kernel.dk>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>
Cc: Vincent Guittot <vincent.guittot at linaro.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+3-5io_uring/poll.c
+3-51 files

Linux/linux 79b6fbd — fs eventpoll.c

eventpoll: don't claim real exclusivity for EPOLLEXCLUSIVE

An EPOLLEXCLUSIVE entry that wakes an epoll_wait()er returns 1, and
because it was queued as an exclusive waiter that stops the wakeup walk.

But nothing makes the epoll user consume the event: it may be killed,
time out, pick another ready fd, or just not read.  Anything queued
behind the entry - a blocked pipe reader, an accept()er, a recv()er -
then sleeps with the event pending.

Queue it with WQ_FLAG_POLL_EXCLUSIVE instead: still only one epoll
instance is woken per wakeup, but real waiters are not skipped.

Reported-by: Mani Tofigh <mt4022 at columbia.edu>
Cc: Christian Brauner <brauner at kernel.org>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Juri Lelli <juri.lelli at redhat.com>

    [2 lines not shown]
DeltaFile
+2-3fs/eventpoll.c
+2-31 files

Linux/linux fc9b031 — include/linux wait.h, kernel/sched wait.c

sched/wait: add WQ_FLAG_POLL_EXCLUSIVE for user space waiters

An exclusive waiter whose wake function returns a positive return value
to indicate that it has successfully been woken up stops the wakeup
walk, on the understanding that it will handle the event.

However, user space consumers - like eventpoll or io_uring - want to be
woken up, and want to avoid the thundering herd issue.  So they used an
exclusive wait - but without any actual guarantee that they will then
meaningfully handle the event.

So the wakeup could be lost, and real waiters would be left pending.

Add a separate flag for these kind of "exclusive poll" cases, which is
effectively what these user space waiters are.  Only the first such
entry that accepts a wakeup is woken, as now, but they don't count
against nr_exclusive and it doesn't stop the walk.

Wake-all (nr_exclusive == 0, including POLLFREE) still calls every entry.

    [9 lines not shown]
DeltaFile
+13-1kernel/sched/wait.c
+1-0include/linux/wait.h
+14-12 files

Linux/linux 303e403 — net/sctp socket.c

sctp: don't let a blocked reader take write-space wakeups

sctp_wait_for_packet() waits exclusively on sk_sleep() with the default
autoremove wake function, so it accepts any wakeup and consumes it.

Then __sctp_write_space() sends EPOLLOUT with a wake-one wakeup:
sctp_wait_for_packet() wakes up, finds no data, goes back to sleep, and
the walk stops.

End result: anybody else queued behind it that was waiting for EPOLLOUT
will never see it.

Filter on EPOLLIN | EPOLLERR like receiver_wake_function() in
net/core/datagram.c.  State changes (using sock_def_wakeup()) use an
unkeyed wake-all and still get through and will ignore the exclusive
nature of sctp_wait_for_packet().

Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner at gmail.com>

    [5 lines not shown]
DeltaFile
+10-1net/sctp/socket.c
+10-11 files

Linux/linux 8d7fe98 — drivers/hid hid-sensor-hub.c wacom_wac.c, drivers/hid/i2c-hid i2c-hid-acpi.c

Merge tag 'hid-for-linus-2026112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID fixes from Jiri Kosina:
 "Mostly functional code fixes all over the place, plus a few new device
  IDs support.

  The amount of patches is slightly higher than I'd like to see for rc4,
  and there are two reasons for it -- the amount of patches is much
  higher overall, due to all the AI fixes coming to the driver land, and
  both myself and Benjamin have been pretty much unable to process
  incoming patches for a past couple weeks for various reasons; but
  we're getting back on track"

* tag 'hid-for-linus-2026112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (42 commits)
  HID: nintendo: release the player ID when LED setup fails
  HID: quirks: add ALWAYS_POLL quirk for Keychron Link receiver
  HID: wacom: Prevent NULL dereference in wireless work
  HID: intel-thc-hid: intel-quickspi: validate GET REPORT response size
  HID: apple: Add "F108Pro Dongle" to the list of non-apple keyboards

    [16 lines not shown]
DeltaFile
+89-35drivers/hid/hid-sensor-custom.c
+39-52drivers/hid/hid-vivaldi-common.c
+65-0drivers/hid/i2c-hid/i2c-hid-acpi.c
+40-19drivers/hid/hid-roccat.c
+31-10drivers/hid/wacom_wac.c
+22-5drivers/hid/hid-sensor-hub.c
+286-12126 files not shown
+426-17032 files

Linux/linux 42e2253 — Documentation/process maintainer-kvm-arm64.rst, arch/arm64/kvm config.c

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "A large set of fixes, mostly for Arm but almost all architectures
  are represented.

  arm64 MMU fixes:

   - Correctly sanitise the TCR_EL2 register

   - Stop advertising LPA2 to NV guest when it isn't supported

   - Correctly convert EH2==0's view of TCR_EL2 into the E2H==1 format

   - Make sure an EL2 mapping is immediately visible to the hypervisor
     code, as we don't necessarily require ETS

   - Address a horrible situation where a guest can livelock when trying
     to solve a permission fault whilst the underlying S2 PTs have AF=0

    [192 lines not shown]
DeltaFile
+235-23tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c
+151-39arch/s390/kvm/gmap/gmap.c
+181-0Documentation/process/maintainer-kvm-arm64.rst
+47-86arch/s390/kvm/s390/vsie.c
+125-0arch/arm64/tools/sysreg
+113-6arch/arm64/kvm/config.c
+852-15496 files not shown
+1,857-529102 files

Linux/linux 983cf50 — fs/ext4 Makefile mballoc.c

ext4: add KUnit tests for fs/ext4/fsmap.c

Add KUnit test suite ext4_fsmap_test in fs/ext4/fsmap-test.c covering
FS_IOC_GETFSMAP reverse-mapping queries in fs/ext4/fsmap.c:

- ext4_fsmap_from_internal() and ext4_fsmap_to_internal() block/byte
  conversions across 1K, 4K, and 64K block sizes
- ext4_getfsmap() validation of flags, device IDs, inverted keys,
  out-of-range physical offsets, and missing group descriptors
- fixed per-group metadata synthesis (superblock, GDT, reserved GDT,
  block bitmap, inode bitmap, inode table), free extents, and
  EXT4_FMR_OWN_UNKNOWN gaps in the middle and at EOFS
- flex_bg adjacent fixed-metadata merging and cross-group free-extent
  coalescing via gfi_lastfree
- 1K s_first_data_block offset handling, bigalloc cluster scaling, and
  META_BG reserved-GDT suppression
- count-only queries, bounded continuation-key pagination, formatter
  abort propagation, and external journal device reporting

Signed-off-by: Theodore Ts'o <tytso at mit.edu>
DeltaFile
+796-0fs/ext4/fsmap-test.c
+3-0fs/ext4/mballoc.c
+3-0fs/ext4/fsmap.c
+1-1fs/ext4/Makefile
+803-14 files

Linux/linux 0af3bcb — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/mmp.c

Add a KUnit test suite (ext4_mmp_test) covering multi-mount protection
checksums, block I/O validation, and mount state transitions in
fs/ext4/mmp.c:

- CRC32C generation and verification in ext4_mmp_csum_set() and
  ext4_mmp_csum_verify() with and without METADATA_CSUM
- Block read/write error handling, magic validation (-EFSCORRUPTED),
  CRC mismatch handling (-EFSBADCRC), and buffer cleanup in
  read_mmp_block() and write_mmp_block()
- ext4_multi_mount_protect() validation of out-of-range MMP blocks,
  EXT4_MMP_SEQ_FSCK rejection (-EBUSY), EXT4_MMP_SEQ_CLEAN claim and
  ext4_stop_mmpd() teardown, active/racing node sequence conflicts,
  check_interval clamping, interrupted waits (-ETIMEDOUT), and kthread
  startup failure

Signed-off-by: Theodore Ts'o <tytso at mit.edu>
DeltaFile
+661-0fs/ext4/mmp-test.c
+90-27fs/ext4/mmp.c
+18-2fs/ext4/ext4.h
+1-1fs/ext4/Makefile
+770-304 files

Linux/linux 0940fb9 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/move_extent.c

Add a KUnit test suite (ext4_move_extent_test) covering online extent
swapping and validation helpers in fs/ext4/move_extent.c:

- Ordered i_data_sem lock acquisition/release in
  ext4_double_down_write_data_sem() and ext4_double_up_write_data_sem()
- File, feature, and mode checks in mext_check_validity() (same inode,
  cross-sb, non-regular, bigalloc, DAX, data journaling, encrypted,
  non-extent, SUID/SGID, immutable/append, swapfile, quota, zero size)
- Sub-page alignment, EXT_MAX_BLOCKS bounds, and EOF clamping in
  mext_check_adjust_range()
- End-to-end ext4_move_extents() across origin/donor holes, unwritten
  extent moves, written MEXT_COPY_DATA with extent splitting and page
  cache preservation, unwritten-origin zeroing, and -EBUSY release

Signed-off-by: Theodore Ts'o <tytso at mit.edu>
DeltaFile
+1,023-0fs/ext4/move_extent-test.c
+19-2fs/ext4/move_extent.c
+8-0fs/ext4/ext4.h
+2-1fs/ext4/Makefile
+1,052-34 files

Linux/linux bae28a1 — fs/ext4 extents.c ext4_jbd2.c

ext4: add KUnit regression tests for inode migration fixes

Add KUnit regression tests in fs/ext4/migrate-test.c covering the
ext4_ext_migrate() bug fixes in the tree:

- test_ext_migrate_caps_long_run_at_init_max_len(): verify that a
  contiguous run longer than EXT_INIT_MAX_LEN is split into multiple
  initialized extents, covering commit b0a3f2c102e8 ("ext4: cap
  migration extent length at EXT_INIT_MAX_LEN").
- test_ext_migrate_survives_handle_restart(): verify that a handle
  restart during extent insertion does not abort migration, covering
  commit 3b6aee59883c ("ext4: clear journal restart indication after
  inserting extent").
- test_ext_migrate_reports_concurrent_allocation() and an -EIO check in
  test_ext_migrate_error_rollback_frees_tmp_extent_blocks(): verify that
  migration errors are returned to the caller instead of being
  overwritten, covering commit 82e2a5743b6a ("ext4: don't clobber the
  migration error in ext4_ext_migrate()").
- test_ext_migrate_credit_or_dirty_failure_keeps_live_blocks(): verify

    [15 lines not shown]
DeltaFile
+326-3fs/ext4/migrate-test.c
+4-0fs/ext4/extents.c
+4-0fs/ext4/ext4_jbd2.c
+334-33 files

Linux/linux dedf8d3 — fs/ext4 Makefile namei.c

ext4: add KUnit tests for fs/ext4/dir.c

Add a KUnit test suite (ext4_dir_test) in fs/ext4/dir-test.c covering
directory entry validation, hash-cookie helpers, directory llseek, and
both linear and HTree directory iteration in fs/ext4/dir.c:

- __ext4_check_dir_entry() and ext4_check_all_de() validation across
  valid blocks (including fake '.', '..', and metadata_csum tail
  entries, as well as encrypted+casefolded extended-hash entries) and
  corrupt rec_len, alignment, name_len, block-end slack, overrun,
  out-of-bounds inode numbers, and full-block '.' entries.
- is_dx_dir(), get_dtype(), and 32-bit vs 64-bit HTree telldir hash
  position conversions (hash2pos, pos2maj_hash, pos2min_hash, and
  ext4_get_htree_eof).
- ext4_dir_operations open(), llseek() (64-bit and 32-bit HTree EOF
  bounds vs non-DX s_bitmap_maxbytes/SEEK_END bounds and cookie
  invalidation), and release().
- ext4_htree_store_dirent() rbtree ordering across major/minor hashes,
  64-bit hash collision chaining, and ext4_htree_free_dir_info().

    [13 lines not shown]
DeltaFile
+993-0fs/ext4/dir-test.c
+33-0fs/ext4/dir.c
+8-0fs/ext4/ext4.h
+4-0fs/ext4/namei.c
+2-1fs/ext4/Makefile
+1,040-15 files

Linux/linux 8639635 — fs/ext4 extents.c extents-test.c

ext4: expand KUnit tests in fs/ext4/extents-test.c for file range operations

Expand ext4_extents_test to cover high-level file-range operations and
reporting entry points in fs/ext4/extents.c:

- ext4_fallocate() mode validation (unsupported flags, encrypted
  collapse/insert rejection, FALLOC_FL_WRITE_ZEROES device limit check,
  non-extent inode rejection), preallocation with and without
  FALLOC_FL_KEEP_SIZE, and hole punching via FALLOC_FL_PUNCH_HOLE
- ext4_zero_range() via FALLOC_FL_ZERO_RANGE (written-to-unwritten split
  and EOF extension) and FALLOC_FL_WRITE_ZEROES (block zeroouts,
  unwritten-to-written conversion, and orphan tracking across EOF)
- ext4_collapse_range() alignment/EOF validation, block freeing,
  left-shift of trailing extents, and adjacent extent coalescing
- ext4_insert_range() alignment/EOF/maxbytes validation, mid-extent
  splitting, right-shift of trailing extents, and i_size growth
- ext4_convert_unwritten_extents(),
  ext4_convert_unwritten_extents_atomic(), and
  ext4_convert_unwritten_io_end_vec() IO completion conversions

    [4 lines not shown]
DeltaFile
+526-2fs/ext4/extents-test.c
+6-0fs/ext4/extents.c
+532-22 files

Linux/linux f316c43 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/sysfs.c

Add a KUnit test suite (ext4_sysfs_test) covering ext4 sysfs attribute
show/store handlers, feature capability attributes, and sysfs/procfs
registration in fs/ext4/sysfs.c:

- Generic pointer attributes across sbi, superblock, and explicit
  targets (attr_pointer_ui, attr_pointer_ul, attr_pointer_pi negative
  value rejection, attr_pointer_u8, attr_pointer_u64 LE64 decoding,
  attr_pointer_string 32-byte bounding, and attr_pointer_atomic).
- Range-checked read-write attributes: inode_readahead_blks power-of-2
  and upper-bound enforcement, reserved_clusters bounds against total
  clusters, mb_best_avail_max_trim_order <= 64, mb_group_prealloc <=
  s_clusters_per_group, and err_report_sec <= 1 year.
- Computed read-only attributes: delayed_allocation_blocks cluster-to-
  block scaling, session_write_kbytes and lifetime_write_kbytes sector
  accounting, sra_exceeded_retry_limit percpu summation, 40-bit error
  timestamps (first_error_time / last_error_time), and journal_task.
- Feature capability attributes under /sys/fs/ext4/features, error

    [5 lines not shown]
DeltaFile
+679-0fs/ext4/sysfs-test.c
+55-0fs/ext4/sysfs.c
+8-0fs/ext4/ext4.h
+2-1fs/ext4/Makefile
+744-14 files

Linux/linux 00ab256 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/migrate.c

Add the ext4_migrate_test KUnit suite in fs/ext4/migrate-test.c to test
online inode format migration between indirect block maps and extent
trees in fs/ext4/migrate.c:

- ext4_ext_migrate() precondition guards, fast symlink no-op handling,
  and temporary inode allocation error propagation
- direct and single-indirect physically contiguous block coalescing,
  sparse logical hole preservation, and indirect metadata freeing
- double-indirect and triple-indirect tree traversal and multi-level
  extent tree construction with proper i_csum_seed propagation
- error rollback freeing allocated temporary extent tree blocks while
  preserving the original indirect inode layout
- ext4_ext_swap_inode_data() concurrent block allocation detection via
  EXT4_STATE_EXT_MIGRATE (-EAGAIN)
- ext4_ind_migrate() conversion of empty and single-extent inodes back
  to direct block maps and rejection of unsupported layouts


    [4 lines not shown]
DeltaFile
+1,061-0fs/ext4/migrate-test.c
+11-0fs/ext4/migrate.c
+6-2fs/ext4/ext4.h
+1-1fs/ext4/Makefile
+1,079-34 files

Linux/linux 7ea8513 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/super.c

Add a KUnit test suite (ext4_super_test) covering superblock validation,
geometry checks, metadata checksums, mount options, overhead/statfs
accounting, and persistent error recording in fs/ext4/super.c:

- Feature flag compatibility in ext4_feature_set_ok() and
  ext4_check_feature_compatibility() across RW/RO mounts, bigalloc
  constraints, Hurd creator-OS restrictions, DAX, and encryption levels.
- Inode, block-group, cluster-size, and directory hash initialization in
  ext4_inode_info_init(), ext4_block_group_meta_init(),
  ext4_handle_clustersize(), and ext4_hash_info_init().
- Filesystem geometry validation in ext4_check_geometry(), descriptor
  location arithmetic in descriptor_loc() (linear and meta_bg),
  superblock and group descriptor CRC16/CRC32C verification, descriptor
  overlap checks in ext4_check_descriptors(), and flex_bg counter
  aggregation in ext4_fill_flex_info() / ext4_alloc_flex_bg_array().
- Maximum file size helpers ext4_max_size() / ext4_max_bitmap_size(),
  stripe selection in ext4_get_stripe_size(), reserved cluster defaults

    [8 lines not shown]
DeltaFile
+1,345-0fs/ext4/super-test.c
+219-0fs/ext4/super.c
+45-0fs/ext4/ext4.h
+1-1fs/ext4/Makefile
+1,610-14 files

Linux/linux c70aa27 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/resize.c

Add a KUnit test suite (ext4_resize_test) covering online filesystem
resizing, group validation, flex_bg table packing, backup descriptor
reservation, and meta_bg conversion in fs/ext4/resize.c:

- Precondition checks in ext4_resize_begin() and EXT4_FLAGS_RESIZING
  mutual exclusion with ext4_resize_end().
- Backup group iteration in ext4_list_backups() (sparse_super powers of
  3/5/7, dense non-sparse sequence, and sparse_super2 s_backup_bgs) and
  reserved GDT validation in verify_reserved_gdb().
- Group geometry and overlap validation in verify_group_input() across
  partial prior groups, reserved-block ratios, out-of-bounds bitmaps and
  inode tables, bitmap collisions, and superblock/GDT overhead overlaps.
- Flex group batch sizing in alloc_flex_gd(), descriptor flag and
  partial-group initialization in ext4_setup_next_flex_gd(), and packed
  metadata table placement and -ENOSPC handling in
  ext4_alloc_group_tables().
- Online partial-last-group extension in ext4_group_extend() updating

    [13 lines not shown]
DeltaFile
+1,336-0fs/ext4/resize-test.c
+78-24fs/ext4/resize.c
+32-0fs/ext4/ext4.h
+2-1fs/ext4/Makefile
+1,448-254 files

Linux/linux 7ac9b41 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/indirect.c

Add the ext4_indirect_test KUnit suite in fs/ext4/indirect-test.c to
test legacy direct, single-, double-, and triple-indirect block mapping,
truncation, and hole punching in fs/ext4/indirect.c:

- ext4_block_to_path() offset decomposition, boundary distance, and
  out-of-range block rejection, plus ext4_ind_trans_blocks() credits
- ext4_ind_map_blocks() read-only lookup across contiguous runs,
  EXT4_MAP_BOUNDARY detection, and multi-level hole span calculation
- ext4_ind_map_blocks() allocation and branch splicing across direct,
  IND, DIND, and TIND depths
- error handling (out-of-range logical/physical blocks, bigalloc
  rejection, indirect read I/O failure, corrupt indirect blockref) and
  partial branch allocation unwind freeing intermediate metadata blocks
- ext4_ind_truncate() partial shared-branch truncation, indirect root
  detachment, and full truncation to zero
- ext4_ind_remove_space() hole punching within direct blocks, across
  mixed levels, and converging on shared IND and DIND blocks

    [8 lines not shown]
DeltaFile
+1,293-0fs/ext4/indirect-test.c
+16-2fs/ext4/indirect.c
+6-1fs/ext4/super.c
+4-0fs/ext4/ext4.h
+2-1fs/ext4/Makefile
+1,321-45 files

Linux/linux 6fa4f16 — fs/ext4 Makefile ext4.h

ext4: add KUnit tests for fs/ext4/ioctl.c

Add a KUnit test suite (ext4_ioctl_test) covering superblock online
tuning, backup superblock propagation, inode data swapping, fileattr
validation, forced shutdown, and ioctl dispatch in fs/ext4/ioctl.c:

- Superblock modification callbacks (ext4_sb_setlabel, ext4_sb_setuuid,
  and ext4_sb_setparams across error behavior, mount counts, 64-bit
  reserved blocks, 32-bit split reserved uid/gid, hash/RAID/encoding
  fields, mount_opts, DIR_INDEX / CSUM_SEED feature edits, and
  FORCE_FSCK).
- Parameter validation and normalization in ext4_validate_tune_sb_params
  (-E2BIG mount_opts, -EOPNOTSUPP flags/feature clears, reserved_blocks
  and hash algorithm bounds, DIR_INDEX hash seed initialization, and
  CASEFOLD encoding defaults).
- Primary and sparse_super backup superblock updates via
  ext4_update_backup_sb, ext4_update_superblocks_fn (including
  EXT4_FLAGS_RESIZING contention and unjournaled >2 backup updates), and
  ext4_update_overhead skip/force semantics.

    [10 lines not shown]
DeltaFile
+1,198-0fs/ext4/ioctl-test.c
+179-70fs/ext4/ioctl.c
+33-0fs/ext4/ext4.h
+1-1fs/ext4/Makefile
+1,411-714 files

Linux/linux 05f2b69 — fs/ext4 Makefile block_validity.c

ext4: add KUnit tests for fs/ext4/block_validity.c

Add the ext4_block_validity_test KUnit test suite in
fs/ext4/block_validity-test.c (16 test cases, 40 subtests total) to
comprehensively exercise system-zone rbtree construction, RCU release,
block range validation, reserved journal inode protection, and indirect
block reference checking in fs/ext4/block_validity.c using an in-memory
VFS superblock and mock block device without requiring a mounted disk:

- Bounds and 64-bit overflow checks (ext4_sb_block_valid and
  ext4_inode_block_valid) across 1KiB (s_first_data_block = 1) and 4KiB
  (s_first_data_block = 0) geometries, exact end-of-filesystem single
  and multi-block spans, 64-bit u64 addition wrap-around, >32-bit block
  counts under EXT4_FEATURE_INCOMPAT_64BIT, and high-32-bit masking when
  64bit is cleared.
- System-zone lifecycle management (ext4_setup_system_zone and
  ext4_release_system_zone), covering pre-setup NULL behavior, RCU
  publication and teardown, and idempotent double-release handling.
- Multi-group sparse_super and flex_bg layouts (including groups with

    [27 lines not shown]
DeltaFile
+1,520-0fs/ext4/block_validity-test.c
+6-0fs/ext4/block_validity.c
+2-1fs/ext4/Makefile
+1,528-13 files

Linux/linux 0dad7be — fs/ext4 Makefile balloc.c

ext4: add KUnit tests for fs/ext4/balloc.c

Add the ext4_balloc_test KUnit test suite in fs/ext4/balloc-test.c (29
test cases, 43 subtests total) to comprehensively exercise block bitmap
management, group descriptor and overhead calculations, cluster pool
reservation, allocation retry policy, metadata block allocation, and
goal block selection in fs/ext4/balloc.c using an in-memory VFS
superblock, mock block device, and deterministic block pool without
requiring a mounted block device:

- Block-to-group and cluster-offset mapping (ext4_get_group_number and
  ext4_get_group_no_and_offset) across 1K and 4K block sizes, standard
  shift-based vs. non-standard do_div group geometries, bigalloc
  multi-block clusters, s_first_data_block offsets, >32-bit physical
  block numbers, and optional NULL output pointers.
- Backup superblock placement (ext4_bg_has_super) across dense
  filesystems, sparse_super powers of 3, 5, and 7, and sparse_super2
  explicit s_backup_bgs configurations.
- Group descriptor table and base metadata block counts

    [44 lines not shown]
DeltaFile
+2,400-0fs/ext4/balloc-test.c
+10-1fs/ext4/balloc.c
+2-1fs/ext4/Makefile
+2,412-23 files

Linux/linux c5c8038 — fs/ext4 ext4_jbd2.c bitmap.c

ext4: add KUnit tests for fs/ext4/ialloc.c

Add the ext4_ialloc_test KUnit test suite in fs/ext4/ialloc-test.c (28
test cases, 33 subtests total) to comprehensively exercise inode bitmap
management, group selection heuristics, inode allocation, freeing,
orphan lookup, and lazy inode table initialization in fs/ext4/ialloc.c
using an in-memory VFS superblock, mock block device, and deterministic
block pool without requiring a mounted block device:

- Bitmap padding and asynchronous read completion helpers
  (ext4_mark_bitmap_end and ext4_end_bitmap_read) across unaligned and
  byte-aligned start/end bit boundaries, partial single-byte updates,
  no-op guards, BLK_STS_OK completion, and BLK_STS_IOERR / BIO_QUIET
  failure handling.
- Inode bitmap validation and loading (ext4_validate_inode_bitmap and
  ext4_read_inode_bitmap), covering CRC32C verification, out-of-group
  metadata block overlap detection, EXT4_FC_REPLAY and buffer_verified
  short-circuits, cache hits vs. synchronous disk reads, lazy
  EXT4_BG_INODE_UNINIT bitmap initialization, and fault injection across

    [57 lines not shown]
DeltaFile
+2,731-0fs/ext4/ialloc-test.c
+82-11fs/ext4/ialloc.c
+21-0fs/ext4/ext4.h
+17-0fs/ext4/super.c
+5-0fs/ext4/bitmap.c
+4-0fs/ext4/ext4_jbd2.c
+2,860-112 files not shown
+2,865-128 files

Linux/linux 07ab120 — fs/ext4 super.c Makefile

ext4: add KUnit tests for fs/ext4/orphan.c

Add the ext4_orphan_test KUnit test suite in fs/ext4/orphan-test.c (22
test cases, 25 subtests total when CONFIG_QUOTA is enabled; 21 test
cases, 24 subtests otherwise) to comprehensively exercise orphan inode
tracking, orphan file management, and mount-time orphan recovery in
fs/ext4/orphan.c using an in-memory VFS superblock, mock block device,
and deterministic buffer pool without requiring a mounted block device:

- Orphan block geometry and empty-state checks
  (ext4_inodes_per_orphan_block across 1K, 2K, 4K, and 64K block sizes,
  and ext4_orphan_file_empty across disabled feature, zero-block files,
  and multi-block occupancy transitions).
- Superblock linked-list orphan insertion (ext4_orphan_add), covering
  no-journal and bad-inode early exits, I_NEW unlocked insertion and
  deletion, idempotency when already tracked via i_orphan or
  EXT4_STATE_ORPHAN_FILE, LIFO chaining across regular, directory, and
  symlink inodes with superblock CRC32C updates, NEXT_ORPHAN boundary
  checks at s_inodes_count vs. s_inodes_count + 1, and journal/iloc

    [35 lines not shown]
DeltaFile
+2,372-0fs/ext4/orphan-test.c
+5-0fs/ext4/orphan.c
+1-1fs/ext4/Makefile
+2-0fs/ext4/inode.c
+1-0fs/ext4/super.c
+2,381-15 files

Linux/linux 9627bae — fs/ext4 block_validity.c block_validity-test.c

ext4: check multi-block overlap on left traversal in add_system_zone()

When walking system_blks->root to insert [start_blk, start_blk + count),
add_system_zone() takes the left branch whenever start_blk <
entry->start_blk instead of checking that the entire range ends at or
before entry->start_blk (unlike ext4_sb_block_valid(), which checks
start_blk + count - 1 < entry->start_blk).

As a result, a corrupt multi-block metadata range (such as a group's
inode table or a reserved journal inode extent mapped in
ext4_protect_reserved_inode() before sbi->s_system_blks is published)
that starts strictly before an existing system zone and extends into or
across it traverses rb_left instead of returning -EFSCORRUPTED. This
inserts overlapping intervals into system_blks->root and breaks the
disjoint-interval invariant relied upon by ext4_sb_block_valid() (for
example, a lookup on blocks past entry->start_blk + entry->count
branches right and misses the overlapping zone stored in rb_left). A
corrupt 64-bit start_blk whose start_blk + count wraps around u64 can
similarly corrupt the rbtree ordering.

    [10 lines not shown]
DeltaFile
+68-0fs/ext4/block_validity-test.c
+4-1fs/ext4/block_validity.c
+72-12 files

Linux/linux fe3d20e — fs/ext4 namei-test.c xattr-test.c

ext4: enable full feature coverage in fs/ext4/.kunitconfig

Enable CONFIG_EXT4_FS_POSIX_ACL, CONFIG_EXT4_FS_SECURITY,
CONFIG_FS_VERITY, CONFIG_FS_ENCRYPTION, CONFIG_QUOTA, CONFIG_QFMT_V2,
and CONFIG_UNICODE in fs/ext4/.kunitconfig so conditional ext4 source
files and feature-gated code paths (POSIX ACLs, security xattrs,
fs-verity, fscrypt, quota accounting, and UTF-8 casefolding) are
compiled and exercised during KUnit runs.

Fix mock superblock and test setup bugs in existing KUnit suites exposed
by enabling these Kconfig options:

- Provide .get_dquots callbacks in mock super_operations under
  CONFIG_QUOTA in block_validity-test.c, extents-test.c,
  fast_commit-test.c, inline-test.c, inode-test.c, mballoc-test.c,
  namei-test.c, and xattr-test.c so dquot_drop() does not dereference a
  NULL callback during ext4_clear_inode().
- Populate sb->s_cop = &ext4_cryptops under CONFIG_FS_ENCRYPTION in
  balloc-test.c, extents-test.c, fast_commit-test.c, inline-test.c,

    [8 lines not shown]
DeltaFile
+19-8fs/ext4/inode-test.c
+14-2fs/ext4/xattr-test.c
+14-2fs/ext4/fast_commit-test.c
+14-2fs/ext4/extents-test.c
+15-1fs/ext4/inline-test.c
+12-2fs/ext4/namei-test.c
+88-174 files not shown
+121-1710 files

Linux/linux 3ca8192 — fs/ext4 page-io.c ialloc.c

ext4: expand KUnit tests for fs/ext4/inode.c

Expand the ext4_inode_test KUnit test suite in fs/ext4/inode-test.c from
1 parameterized test (16 timestamp decoding subtests) to 26 test cases
(41 subtests total) to comprehensively exercise fs/ext4/inode.c using an
in-memory VFS superblock, mock block device, and deterministic block pool
without requiring a mounted block device:

- Extra timestamp encoding and 64-bit round-trips across all 16 boundary
  vectors, 256-byte inodes with 34-bit seconds + nanoseconds, and
  128-byte old inodes storing signed 32-bit seconds with zeroed
  nanoseconds.
- Raw inode CRC32C checksum computation and verification
  (ext4_inode_csum_set and ext4_inode_csum_verify) across legacy
  non-csum filesystems, 128-byte inodes (16-bit lo CRC), 256-byte inodes
  with i_extra_isize = 0 vs >= 4 (32-bit CRC), and bit-flip corruptions.
- Inode block count encoding and decoding (ext4_inode_blocks_set and
  ext4_inode_blocks) across 32-bit 512B sectors, 48-bit huge_file
  sectors, and EXT4_HUGE_FILE_FL filesystem block units.

    [58 lines not shown]
DeltaFile
+3,496-4fs/ext4/inode-test.c
+144-6fs/ext4/inode.c
+29-0fs/ext4/ext4.h
+16-2fs/ext4/super.c
+3-0fs/ext4/ialloc.c
+1-0fs/ext4/page-io.c
+3,689-126 files