Commit 83f1454877cc for kernel

commit 83f1454877cc292b88baf13c829c16ce6937d120
Merge: dac3b26eae7b c143957520c6
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Thu Jun 18 09:42:02 2026 -0700

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

    Pull ext4 updates from Ted Ts'o:

     - A major rework of the fast commit mechanism to avoid lock contention
       and deadlocks. We also export snapshot statistics in
       /proc/fs/ext4/*/fc_info

     - Performance optimization for directory hash computation by processing
       input in 4-byte chunks and removing function pointers, along with new
       KUnit tests for directory hash

     - Cleanups in JBD2 to remove special slabs and use kmalloc() instead

     - Various bug fixes, including:
         - Early validation of donor superblock in EXT4_IOC_MOVE_EXT to
           avoid cross-fs deadlock
         - Fix for a kernel BUG in ext4_write_inline_data_end under
           data=journal
         - Fix for a NULL dereference in jbd2_journal_dirty_metadata when
           handle is aborted
         - Fix for an underflow in JBD2 fast commit block initialization
           check
         - Fix for LOGFLUSH shutdown ordering to ensure ordered data
           writeback
         - Miscellaneous fixes for error path return values and KUnit
           assertions

    * tag 'ext4_for_linus-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
      ext4: validate donor file superblock early in EXT4_IOC_MOVE_EXT
      ext4: fix kernel BUG in ext4_write_inline_data_end
      ext4: fix ERR_PTR(0) in ext4_mkdir()
      jbd2: remove special jbd2 slabs
      ext4: remove mention of PageWriteback
      ext4: improve str2hashbuf by processing 4-byte chunks and removing function pointers
      ext4: add Kunit coverage for directory hash computation
      ext4: fast commit: export snapshot stats in fc_info
      ext4: fast commit: add lock_updates tracepoint
      ext4: fast commit: avoid i_data_sem by dropping ext4_map_blocks() in snapshots
      ext4: fast commit: avoid self-deadlock in inode snapshotting
      ext4: fast commit: avoid waiting for FC_COMMITTING
      ext4: lockdep: handle i_data_sem subclassing for special inodes
      ext4: fast commit: snapshot inode state before writing log
      jbd2: fix integer underflow in jbd2_journal_initialize_fast_commit()
      ext4: fix fast commit wait/wake bit mapping on 64-bit
      jbd2: check for aborted handle in jbd2_journal_dirty_metadata()
      ext4: Use %pe to print PTR_ERR()
      ext4: fix LOGFLUSH shutdown ordering to allow ordered-mode data writeback
      ext4: replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ()

diff --cc fs/ext4/fast_commit.c
index 5773b85e43cb,4ef796b9b6cb..8e2259799614
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@@ -183,12 -184,24 +184,27 @@@

  #include <trace/events/ext4.h>
  static struct kmem_cache *ext4_fc_dentry_cachep;
+ static struct kmem_cache *ext4_fc_range_cachep;
+
+ /*
+  * Avoid spending unbounded time/memory snapshotting highly fragmented files
+  * under jbd2_journal_lock_updates(). If we exceed this limit, fall back to
+  * full commit.
+  */
+ #define EXT4_FC_SNAPSHOT_MAX_INODES	1024
+ #define EXT4_FC_SNAPSHOT_MAX_RANGES	2048
+
+ static inline void ext4_fc_set_snap_err(int *snap_err, int err)
+ {
+ 	if (snap_err && *snap_err == EXT4_FC_SNAP_ERR_NONE)
+ 		*snap_err = err;
+ }

 -static void ext4_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
 +static void ext4_end_buffer_io_sync(struct bio *bio)
  {
 +	struct buffer_head *bh;
 +	bool uptodate = bio_endio_bh(bio, &bh);
 +
  	BUFFER_TRACE(bh, "");
  	if (uptodate) {
  		ext4_debug("%s: Block %lld up-to-date",