Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH v2 14/34] ext4: Convert write_mmp_block_thawed() to bh_submit()
From: Matthew Wilcox (Oracle) @ 2026-05-28 17:31 UTC (permalink / raw)
  To: Jan Kara
  Cc: Matthew Wilcox (Oracle), Christian Brauner, Christoph Hellwig,
	linux-fsdevel, linux-ext4
In-Reply-To: <20260528173150.1093780-1-willy@infradead.org>

Avoid an extra indirect function call and changing the buffer refcount
by using bh_submit() instead of submit_bh().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/mmp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 6f57c181ff77..7ce361484b38 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -46,9 +46,8 @@ static int write_mmp_block_thawed(struct super_block *sb,
 
 	ext4_mmp_csum_set(sb, mmp);
 	lock_buffer(bh);
-	bh->b_end_io = end_buffer_write_sync;
-	get_bh(bh);
-	submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO, bh);
+	bh_submit(bh, REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO,
+			bh_end_write);
 	wait_on_buffer(bh);
 	if (unlikely(!buffer_uptodate(bh)))
 		return -EIO;
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 13/34] ext4: Convert ext4_fc_submit_bh() to bh_submit()
From: Matthew Wilcox (Oracle) @ 2026-05-28 17:31 UTC (permalink / raw)
  To: Jan Kara
  Cc: Matthew Wilcox (Oracle), Christian Brauner, Christoph Hellwig,
	linux-fsdevel, linux-ext4
In-Reply-To: <20260528173150.1093780-1-willy@infradead.org>

Avoid an extra indirect function call by converting
ext4_end_buffer_io_sync() from bh_end_io_t to bio_end_io_t and
calling bh_submit().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/fast_commit.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index b3c22636251d..5773b85e43cb 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -184,8 +184,11 @@
 #include <trace/events/ext4.h>
 static struct kmem_cache *ext4_fc_dentry_cachep;
 
-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",
@@ -659,8 +662,7 @@ static void ext4_fc_submit_bh(struct super_block *sb, bool is_tail)
 	lock_buffer(bh);
 	set_buffer_dirty(bh);
 	set_buffer_uptodate(bh);
-	bh->b_end_io = ext4_end_buffer_io_sync;
-	submit_bh(REQ_OP_WRITE | write_flags, bh);
+	bh_submit(bh, REQ_OP_WRITE | write_flags, ext4_end_buffer_io_sync);
 	EXT4_SB(sb)->s_fc_bh = NULL;
 }
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 12/34] ext4; Convert __ext4_read_bh() to bh_submit()
From: Matthew Wilcox (Oracle) @ 2026-05-28 17:31 UTC (permalink / raw)
  To: Jan Kara
  Cc: Matthew Wilcox (Oracle), Christian Brauner, Christoph Hellwig,
	linux-fsdevel, linux-ext4
In-Reply-To: <20260528173150.1093780-1-willy@infradead.org>

Avoid an extra indirect function call and changing the buffer refcount
by converting ext4_end_bitmap_read() from bh_end_io_t to bio_end_io_t
and calling bh_submit().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/ext4.h   | 10 +++++-----
 fs/ext4/ialloc.c |  6 ++++--
 fs/ext4/super.c  | 12 ++++++------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 94283a991e5c..6af11f0ff1c5 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2959,7 +2959,7 @@ extern unsigned long ext4_count_dirs(struct super_block *);
 extern void ext4_mark_bitmap_end(int start_bit, int end_bit, char *bitmap);
 extern int ext4_init_inode_table(struct super_block *sb,
 				 ext4_group_t group, int barrier);
-extern void ext4_end_bitmap_read(struct buffer_head *bh, int uptodate);
+void ext4_end_bitmap_read(struct bio *bio);
 
 /* fast_commit.c */
 int ext4_fc_info_show(struct seq_file *seq, void *v);
@@ -3184,10 +3184,10 @@ extern struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb,
 						   sector_t block);
 extern struct buffer_head *ext4_sb_bread_nofail(struct super_block *sb,
 						sector_t block);
-extern void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
-				bh_end_io_t *end_io, bool simu_fail);
-extern int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
-			bh_end_io_t *end_io, bool simu_fail);
+void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
+		bio_end_io_t end_io, bool simu_fail);
+int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
+		bio_end_io_t end_io, bool simu_fail);
 extern int ext4_read_bh_lock(struct buffer_head *bh, blk_opf_t op_flags, bool wait);
 extern void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block);
 extern int ext4_seq_options_show(struct seq_file *seq, void *offset);
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 3fd8f0099852..9aacd629a683 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -66,14 +66,16 @@ void ext4_mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
 		memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
 }
 
-void ext4_end_bitmap_read(struct buffer_head *bh, int uptodate)
+void ext4_end_bitmap_read(struct bio *bio)
 {
+	struct buffer_head *bh;
+	bool uptodate = bio_endio_bh(bio, &bh);
+
 	if (uptodate) {
 		set_buffer_uptodate(bh);
 		set_bitmap_uptodate(bh);
 	}
 	unlock_buffer(bh);
-	put_bh(bh);
 }
 
 static int ext4_validate_inode_bitmap(struct super_block *sb,
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6a77db4d3124..bc7faedcb8e4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -161,7 +161,7 @@ MODULE_ALIAS("ext3");
 
 
 static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
-				  bh_end_io_t *end_io, bool simu_fail)
+				  bio_end_io_t end_io, bool simu_fail)
 {
 	if (simu_fail) {
 		clear_buffer_uptodate(bh);
@@ -176,13 +176,13 @@ static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
 	 */
 	clear_buffer_verified(bh);
 
-	bh->b_end_io = end_io ? end_io : end_buffer_read_sync;
-	get_bh(bh);
-	submit_bh(REQ_OP_READ | op_flags, bh);
+	if (!end_io)
+		end_io = bh_end_read;
+	bh_submit(bh, REQ_OP_READ | op_flags, end_io);
 }
 
 void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
-			 bh_end_io_t *end_io, bool simu_fail)
+			 bio_end_io_t end_io, bool simu_fail)
 {
 	BUG_ON(!buffer_locked(bh));
 
@@ -194,7 +194,7 @@ void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
 }
 
 int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
-		 bh_end_io_t *end_io, bool simu_fail)
+		 bio_end_io_t end_io, bool simu_fail)
 {
 	BUG_ON(!buffer_locked(bh));
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2] jbd2: Remove special jbd2 slabs
From: Matthew Wilcox (Oracle) @ 2026-05-28 17:14 UTC (permalink / raw)
  To: Theodore Tso
  Cc: Matthew Wilcox (Oracle), Jan Kara, linux-ext4, linux-fsdevel,
	Mike Rapoport (Microsoft), Vlastimil Babka, Tal Zussman, Jan Kara

When jbd2 was originally written, kmalloc() would not guarantee memory
alignment for the requested objects.  Since commit 59bb47985c1d in 2019,
kmalloc has guaranteed natural alignment for power-of-two allocations.
We can now remove the jbd2 special slabs and just use kmalloc() directly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
---
v2: Rmove b_size parameter (Tal Zussman)

 fs/jbd2/commit.c      |   8 +--
 fs/jbd2/journal.c     | 125 ++----------------------------------------
 fs/jbd2/transaction.c |   8 +--
 include/linux/jbd2.h  |   3 -
 4 files changed, 13 insertions(+), 131 deletions(-)

diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 4e91593d27e5..9ee573948dd8 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -514,10 +514,8 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 		 * leave undo-committed data.
 		 */
 		if (jh->b_committed_data) {
-			struct buffer_head *bh = jh2bh(jh);
-
 			spin_lock(&jh->b_state_lock);
-			jbd2_free(jh->b_committed_data, bh->b_size);
+			kfree(jh->b_committed_data);
 			jh->b_committed_data = NULL;
 			spin_unlock(&jh->b_state_lock);
 		}
@@ -978,7 +976,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 		 * its triggers if they exist, so we can clear that too.
 		 */
 		if (jh->b_committed_data) {
-			jbd2_free(jh->b_committed_data, bh->b_size);
+			kfree(jh->b_committed_data);
 			jh->b_committed_data = NULL;
 			if (jh->b_frozen_data) {
 				jh->b_committed_data = jh->b_frozen_data;
@@ -986,7 +984,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 				jh->b_frozen_triggers = NULL;
 			}
 		} else if (jh->b_frozen_data) {
-			jbd2_free(jh->b_frozen_data, bh->b_size);
+			kfree(jh->b_frozen_data);
 			jh->b_frozen_data = NULL;
 			jh->b_frozen_triggers = NULL;
 		}
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 2040af8c84cb..1621b49de003 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -95,8 +95,6 @@ EXPORT_SYMBOL(jbd2_journal_release_jbd_inode);
 EXPORT_SYMBOL(jbd2_journal_begin_ordered_truncate);
 EXPORT_SYMBOL(jbd2_inode_cache);
 
-static int jbd2_journal_create_slab(size_t slab_size);
-
 #ifdef CONFIG_JBD2_DEBUG
 void __jbd2_debug(int level, const char *file, const char *func,
 		  unsigned int line, const char *fmt, ...)
@@ -385,10 +383,10 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
 			goto escape_done;
 
 		spin_unlock(&jh_in->b_state_lock);
-		tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS | __GFP_NOFAIL);
+		tmp = kmalloc(bh_in->b_size, GFP_NOFS | __GFP_NOFAIL);
 		spin_lock(&jh_in->b_state_lock);
 		if (jh_in->b_frozen_data) {
-			jbd2_free(tmp, bh_in->b_size);
+			kfree(tmp);
 			goto copy_done;
 		}
 
@@ -2062,14 +2060,6 @@ EXPORT_SYMBOL(jbd2_journal_update_sb_errno);
 int jbd2_journal_load(journal_t *journal)
 {
 	int err;
-	journal_superblock_t *sb = journal->j_superblock;
-
-	/*
-	 * Create a slab for this blocksize
-	 */
-	err = jbd2_journal_create_slab(be32_to_cpu(sb->s_blocksize));
-	if (err)
-		return err;
 
 	/* Let the recovery code check whether it needs to recover any
 	 * data from the journal. */
@@ -2697,108 +2687,6 @@ size_t journal_tag_bytes(journal_t *journal)
 		return sz - sizeof(__u32);
 }
 
-/*
- * JBD memory management
- *
- * These functions are used to allocate block-sized chunks of memory
- * used for making copies of buffer_head data.  Very often it will be
- * page-sized chunks of data, but sometimes it will be in
- * sub-page-size chunks.  (For example, 16k pages on Power systems
- * with a 4k block file system.)  For blocks smaller than a page, we
- * use a SLAB allocator.  There are slab caches for each block size,
- * which are allocated at mount time, if necessary, and we only free
- * (all of) the slab caches when/if the jbd2 module is unloaded.  For
- * this reason we don't need to a mutex to protect access to
- * jbd2_slab[] allocating or releasing memory; only in
- * jbd2_journal_create_slab().
- */
-#define JBD2_MAX_SLABS 8
-static struct kmem_cache *jbd2_slab[JBD2_MAX_SLABS];
-
-static const char *jbd2_slab_names[JBD2_MAX_SLABS] = {
-	"jbd2_1k", "jbd2_2k", "jbd2_4k", "jbd2_8k",
-	"jbd2_16k", "jbd2_32k", "jbd2_64k", "jbd2_128k"
-};
-
-
-static void jbd2_journal_destroy_slabs(void)
-{
-	int i;
-
-	for (i = 0; i < JBD2_MAX_SLABS; i++) {
-		kmem_cache_destroy(jbd2_slab[i]);
-		jbd2_slab[i] = NULL;
-	}
-}
-
-static int jbd2_journal_create_slab(size_t size)
-{
-	static DEFINE_MUTEX(jbd2_slab_create_mutex);
-	int i = order_base_2(size) - 10;
-	size_t slab_size;
-
-	if (size == PAGE_SIZE)
-		return 0;
-
-	if (i >= JBD2_MAX_SLABS)
-		return -EINVAL;
-
-	if (unlikely(i < 0))
-		i = 0;
-	mutex_lock(&jbd2_slab_create_mutex);
-	if (jbd2_slab[i]) {
-		mutex_unlock(&jbd2_slab_create_mutex);
-		return 0;	/* Already created */
-	}
-
-	slab_size = 1 << (i+10);
-	jbd2_slab[i] = kmem_cache_create(jbd2_slab_names[i], slab_size,
-					 slab_size, 0, NULL);
-	mutex_unlock(&jbd2_slab_create_mutex);
-	if (!jbd2_slab[i]) {
-		printk(KERN_EMERG "JBD2: no memory for jbd2_slab cache\n");
-		return -ENOMEM;
-	}
-	return 0;
-}
-
-static struct kmem_cache *get_slab(size_t size)
-{
-	int i = order_base_2(size) - 10;
-
-	BUG_ON(i >= JBD2_MAX_SLABS);
-	if (unlikely(i < 0))
-		i = 0;
-	BUG_ON(jbd2_slab[i] == NULL);
-	return jbd2_slab[i];
-}
-
-void *jbd2_alloc(size_t size, gfp_t flags)
-{
-	void *ptr;
-
-	BUG_ON(size & (size-1)); /* Must be a power of 2 */
-
-	if (size < PAGE_SIZE)
-		ptr = kmem_cache_alloc(get_slab(size), flags);
-	else
-		ptr = (void *)__get_free_pages(flags, get_order(size));
-
-	/* Check alignment; SLUB has gotten this wrong in the past,
-	 * and this can lead to user data corruption! */
-	BUG_ON(((unsigned long) ptr) & (size-1));
-
-	return ptr;
-}
-
-void jbd2_free(void *ptr, size_t size)
-{
-	if (size < PAGE_SIZE)
-		kmem_cache_free(get_slab(size), ptr);
-	else
-		free_pages((unsigned long)ptr, get_order(size));
-};
-
 /*
  * Journal_head storage management
  */
@@ -2972,15 +2860,15 @@ static void __journal_remove_journal_head(struct buffer_head *bh)
 	clear_buffer_jbd(bh);
 }
 
-static void journal_release_journal_head(struct journal_head *jh, size_t b_size)
+static void journal_release_journal_head(struct journal_head *jh)
 {
 	if (jh->b_frozen_data) {
 		printk(KERN_WARNING "%s: freeing b_frozen_data\n", __func__);
-		jbd2_free(jh->b_frozen_data, b_size);
+		kfree(jh->b_frozen_data);
 	}
 	if (jh->b_committed_data) {
 		printk(KERN_WARNING "%s: freeing b_committed_data\n", __func__);
-		jbd2_free(jh->b_committed_data, b_size);
+		kfree(jh->b_committed_data);
 	}
 	journal_free_journal_head(jh);
 }
@@ -2999,7 +2887,7 @@ void jbd2_journal_put_journal_head(struct journal_head *jh)
 	if (!jh->b_jcount) {
 		__journal_remove_journal_head(bh);
 		jbd_unlock_bh_journal_head(bh);
-		journal_release_journal_head(jh, bh->b_size);
+		journal_release_journal_head(jh);
 		__brelse(bh);
 	} else {
 		jbd_unlock_bh_journal_head(bh);
@@ -3141,7 +3029,6 @@ static void jbd2_journal_destroy_caches(void)
 	jbd2_journal_destroy_handle_cache();
 	jbd2_journal_destroy_inode_cache();
 	jbd2_journal_destroy_transaction_cache();
-	jbd2_journal_destroy_slabs();
 }
 
 static int __init journal_init(void)
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 4885903bbd10..48ddb566d12d 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1131,7 +1131,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 		if (!frozen_buffer) {
 			JBUFFER_TRACE(jh, "allocate memory for buffer");
 			spin_unlock(&jh->b_state_lock);
-			frozen_buffer = jbd2_alloc(jh2bh(jh)->b_size,
+			frozen_buffer = kmalloc(jh2bh(jh)->b_size,
 						   GFP_NOFS | __GFP_NOFAIL);
 			goto repeat;
 		}
@@ -1159,7 +1159,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 
 out:
 	if (unlikely(frozen_buffer))	/* It's usually NULL */
-		jbd2_free(frozen_buffer, bh->b_size);
+		kfree(frozen_buffer);
 
 	JBUFFER_TRACE(jh, "exit");
 	return error;
@@ -1424,7 +1424,7 @@ int jbd2_journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
 
 repeat:
 	if (!jh->b_committed_data)
-		committed_data = jbd2_alloc(jh2bh(jh)->b_size,
+		committed_data = kmalloc(jh2bh(jh)->b_size,
 					    GFP_NOFS|__GFP_NOFAIL);
 
 	spin_lock(&jh->b_state_lock);
@@ -1445,7 +1445,7 @@ int jbd2_journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
 out:
 	jbd2_journal_put_journal_head(jh);
 	if (unlikely(committed_data))
-		jbd2_free(committed_data, bh->b_size);
+		kfree(committed_data);
 	return err;
 }
 
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 7e785aa6d35d..b68561187e90 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -63,9 +63,6 @@ void __jbd2_debug(int level, const char *file, const char *func,
 #define jbd2_debug(n, fmt, a...)  no_printk(fmt, ##a)
 #endif
 
-extern void *jbd2_alloc(size_t size, gfp_t flags);
-extern void jbd2_free(void *ptr, size_t size);
-
 #define JBD2_MIN_JOURNAL_BLOCKS 1024
 #define JBD2_DEFAULT_FAST_COMMIT_BLOCKS 256
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH] ext4: validate dx count against limit in dx_csum
From: Artem Blagodarenko @ 2026-05-28 16:05 UTC (permalink / raw)
  To: linux-ext4; +Cc: adilger.kernel, Artem Blagodarenko

From: Artem Blagodarenko <artem.blagodarenko@gmail.com>

Sashiko AI, during inspection of the "ext4: replace ext4_dir_entry
with ext4_dir_entry_2" series, reported a missing bounds check on
count against limit in DX block checksum verification and setup
paths.

The code validates that limit fits within block boundaries, but does
not verify that count <= limit. A maliciously crafted filesystem image
could therefore provide an artificially large count value.

Since ext4_dx_csum() uses count to determine the checksum region
size, this may result in an out-of-bounds access crossing page
boundaries into unmapped memory, potentially leading to a crash during
checksum verification.

The same issue exists in ext4_dx_csum_set().

The bug was not introduced by the patch under review, so the fix is sent
separately.

Signed-off-by: Artem Blagodarenko artem.blagodarenko@gmail.com
---
 fs/ext4/namei.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a316fc2ac41b..20b7bac69889 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -472,7 +472,8 @@ static int ext4_dx_csum_verify(struct inode *inode,
 	}
 	limit = le16_to_cpu(c->limit);
 	count = le16_to_cpu(c->count);
-	if (count_offset + (limit * sizeof(struct dx_entry)) >
+	if (!count || count > limit ||
+	    count_offset + (limit * sizeof(struct dx_entry)) >
 	    EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
 		warn_no_space_for_csum(inode);
 		return 0;
@@ -501,7 +502,8 @@ static void ext4_dx_csum_set(struct inode *inode, struct ext4_dir_entry_2 *diren
 	}
 	limit = le16_to_cpu(c->limit);
 	count = le16_to_cpu(c->count);
-	if (count_offset + (limit * sizeof(struct dx_entry)) >
+	if (!count || count > limit ||
+	    count_offset + (limit * sizeof(struct dx_entry)) >
 	    EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
 		warn_no_space_for_csum(inode);
 		return;
-- 
2.43.7


^ permalink raw reply related

* Re: [PATCH v4 08/23] ext4: implement buffered write path using iomap
From: Darrick J. Wong @ 2026-05-28 15:40 UTC (permalink / raw)
  To: Ojaswin Mujoo
  Cc: Zhang Yi, linux-ext4, linux-fsdevel, linux-kernel, tytso,
	adilger.kernel, libaokun, jack, ritesh.list, hch, yi.zhang,
	yizhang089, yangerkun, yukuai
In-Reply-To: <ahXUBgoivo5CFl39@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>

On Tue, May 26, 2026 at 10:40:30PM +0530, Ojaswin Mujoo wrote:
> On Mon, May 11, 2026 at 03:23:28PM +0800, Zhang Yi wrote:
> > From: Zhang Yi <yi.zhang@huawei.com>
> > 
> > Introduce two new iomap_ops instances for ext4 buffered writes:
> > 
> >  - ext4_iomap_buffered_da_write_ops: for delayed allocation mode, using
> >    ext4_da_map_blocks() to map delalloc extents.
> >  - ext4_iomap_buffered_write_ops: for non-delayed allocation mode, using
> >    ext4_iomap_get_blocks() to directly allocate blocks.
> > 
> > Also add ext4_iomap_valid() for the iomap infrastructure to check extent
> > validity.
> > 
> > Key changes and considerations:
> > 
> >  - Unwritten extents for new blocks (dioread_nolock always on)
> >    Since data=ordered mode is not used to prevent stale data exposure in
> >    the non-delayed allocation path, new blocks are always allocated as
> >    unwritten extents.
> 
> Okay makes sense.
> 
> > 
> >  - Short write and write failure handling
> >    a. Delalloc path: On short write or failure, the stale delalloc range
> >       must be dropped and its space reservation released. Otherwise, a
> >       clean folio may cover leftover delalloc extents, causing
> >       inaccurate space reservation accounting.
> 
> Hmm, okay so in the usual buffer head path, seems like during a short
> write we still zero the new buffers we couldn't write and keep it dirty
> (folio_zero_new_buffers()). This way they are still written back and
> the delalloc reservations are used up.
> 
> However in iomap we don't mark the range that we couldnt write as dirty
> so we need to make sure we clear up the stale delalloc mappings. Is this
> correct?

Yes, that's true of iomap's pagecache handling.

--D

> Regards,
> Ojaswin
> 
> >    b. Non-delalloc path: No cleanup of allocated blocks is needed on
> >       short write.
> > 
> >  - Lock ordering reversal
> >    The folio lock and transaction start ordering is reversed compared to
> >    the buffer_head buffered write path. To handle this, the journal
> >    handle must be stopped in iomap_begin() callbacks. The lock ordering
> >    documentation in super.c has been updated accordingly.
> > 
> > Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
> > ---
> >  fs/ext4/ext4.h  |   4 ++
> >  fs/ext4/file.c  |  20 +++++-
> >  fs/ext4/inode.c | 165 +++++++++++++++++++++++++++++++++++++++++++++++-
> >  fs/ext4/super.c |  10 ++-
> >  4 files changed, 192 insertions(+), 7 deletions(-)
> > 
> > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > index 1e27d73d7427..4832e7f7db82 100644
> > --- a/fs/ext4/ext4.h
> > +++ b/fs/ext4/ext4.h
> > @@ -3057,6 +3057,7 @@ int ext4_walk_page_buffers(handle_t *handle,
> >  int do_journal_get_write_access(handle_t *handle, struct inode *inode,
> >  				struct buffer_head *bh);
> >  void ext4_set_inode_mapping_order(struct inode *inode);
> > +int ext4_nonda_switch(struct super_block *sb);
> >  #define FALL_BACK_TO_NONDELALLOC 1
> >  #define CONVERT_INLINE_DATA	 2
> >  
> > @@ -3926,6 +3927,9 @@ static inline void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end)
> >  
> >  extern const struct iomap_ops ext4_iomap_ops;
> >  extern const struct iomap_ops ext4_iomap_report_ops;
> > +extern const struct iomap_ops ext4_iomap_buffered_write_ops;
> > +extern const struct iomap_ops ext4_iomap_buffered_da_write_ops;
> > +extern const struct iomap_write_ops ext4_iomap_write_ops;
> >  
> >  static inline int ext4_buffer_uptodate(struct buffer_head *bh)
> >  {
> > diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> > index eb1a323962b1..7f9bfbbc4a4e 100644
> > --- a/fs/ext4/file.c
> > +++ b/fs/ext4/file.c
> > @@ -299,6 +299,21 @@ static ssize_t ext4_write_checks(struct kiocb *iocb, struct iov_iter *from)
> >  	return count;
> >  }
> >  
> > +static ssize_t ext4_iomap_buffered_write(struct kiocb *iocb,
> > +					 struct iov_iter *from)
> > +{
> > +	struct inode *inode = file_inode(iocb->ki_filp);
> > +	const struct iomap_ops *iomap_ops;
> > +
> > +	if (test_opt(inode->i_sb, DELALLOC) && !ext4_nonda_switch(inode->i_sb))
> > +		iomap_ops = &ext4_iomap_buffered_da_write_ops;
> > +	else
> > +		iomap_ops = &ext4_iomap_buffered_write_ops;
> > +
> > +	return iomap_file_buffered_write(iocb, from, iomap_ops,
> > +					 &ext4_iomap_write_ops, NULL);
> > +}
> > +
> >  static ssize_t ext4_buffered_write_iter(struct kiocb *iocb,
> >  					struct iov_iter *from)
> >  {
> > @@ -313,7 +328,10 @@ static ssize_t ext4_buffered_write_iter(struct kiocb *iocb,
> >  	if (ret <= 0)
> >  		goto out;
> >  
> > -	ret = generic_perform_write(iocb, from);
> > +	if (ext4_inode_buffered_iomap(inode))
> > +		ret = ext4_iomap_buffered_write(iocb, from);
> > +	else
> > +		ret = generic_perform_write(iocb, from);
> >  
> >  out:
> >  	inode_unlock(inode);
> > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> > index 39577a6b65b9..1ae7d3f4a1c8 100644
> > --- a/fs/ext4/inode.c
> > +++ b/fs/ext4/inode.c
> > @@ -3097,7 +3097,7 @@ static int ext4_dax_writepages(struct address_space *mapping,
> >  	return ret;
> >  }
> >  
> > -static int ext4_nonda_switch(struct super_block *sb)
> > +int ext4_nonda_switch(struct super_block *sb)
> >  {
> >  	s64 free_clusters, dirty_clusters;
> >  	struct ext4_sb_info *sbi = EXT4_SB(sb);
> > @@ -3467,6 +3467,15 @@ static bool ext4_inode_datasync_dirty(struct inode *inode)
> >  	return inode_state_read_once(inode) & I_DIRTY_DATASYNC;
> >  }
> >  
> > +static bool ext4_iomap_valid(struct inode *inode, const struct iomap *iomap)
> > +{
> > +	return iomap->validity_cookie == READ_ONCE(EXT4_I(inode)->i_es_seq);
> > +}
> > +
> > +const struct iomap_write_ops ext4_iomap_write_ops = {
> > +	.iomap_valid = ext4_iomap_valid,
> > +};
> > +
> >  static void ext4_set_iomap(struct inode *inode, struct iomap *iomap,
> >  			   struct ext4_map_blocks *map, loff_t offset,
> >  			   loff_t length, unsigned int flags)
> > @@ -3501,6 +3510,8 @@ static void ext4_set_iomap(struct inode *inode, struct iomap *iomap,
> >  	    !ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
> >  		iomap->flags |= IOMAP_F_MERGED;
> >  
> > +	iomap->validity_cookie = map->m_seq;
> > +
> >  	/*
> >  	 * Flags passed to ext4_map_blocks() for direct I/O writes can result
> >  	 * in m_flags having both EXT4_MAP_MAPPED and EXT4_MAP_UNWRITTEN bits
> > @@ -3908,8 +3919,12 @@ const struct iomap_ops ext4_iomap_report_ops = {
> >  	.iomap_begin = ext4_iomap_begin_report,
> >  };
> >  
> > +/* Map blocks */
> > +typedef int (ext4_get_blocks_t)(struct inode *, struct ext4_map_blocks *);
> > +
> >  static int ext4_iomap_map_blocks(struct inode *inode, loff_t offset,
> > -		loff_t length, struct ext4_map_blocks *map)
> > +		loff_t length, ext4_get_blocks_t get_blocks,
> > +		struct ext4_map_blocks *map)
> >  {
> >  	u8 blkbits = inode->i_blkbits;
> >  
> > @@ -3921,6 +3936,9 @@ static int ext4_iomap_map_blocks(struct inode *inode, loff_t offset,
> >  	map->m_len = min_t(loff_t, (offset + length - 1) >> blkbits,
> >  			   EXT4_MAX_LOGICAL_BLOCK) - map->m_lblk + 1;
> >  
> > +	if (get_blocks)
> > +		return get_blocks(inode, map);
> > +
> >  	return ext4_map_blocks(NULL, inode, map, 0);
> >  }
> >  
> > @@ -3938,7 +3956,7 @@ static int ext4_iomap_buffered_read_begin(struct inode *inode, loff_t offset,
> >  	if (WARN_ON_ONCE(ext4_has_inline_data(inode)))
> >  		return -ERANGE;
> >  
> > -	ret = ext4_iomap_map_blocks(inode, offset, length, &map);
> > +	ret = ext4_iomap_map_blocks(inode, offset, length, NULL, &map);
> >  	if (ret < 0)
> >  		return ret;
> >  
> > @@ -3946,6 +3964,147 @@ static int ext4_iomap_buffered_read_begin(struct inode *inode, loff_t offset,
> >  	return 0;
> >  }
> >  
> > +static int ext4_iomap_get_blocks(struct inode *inode,
> > +				 struct ext4_map_blocks *map)
> > +{
> > +	loff_t i_size = i_size_read(inode);
> > +	handle_t *handle;
> > +	int ret;
> > +
> > +	/*
> > +	 * Check if the blocks have already been allocated, this could
> > +	 * avoid initiating a new journal transaction and return the
> > +	 * mapping information directly.
> > +	 */
> > +	if ((map->m_lblk + map->m_len) <=
> > +	    round_up(i_size, i_blocksize(inode)) >> inode->i_blkbits) {
> > +		ret = ext4_map_blocks(NULL, inode, map, 0);
> > +		if (ret < 0)
> > +			return ret;
> > +		if (map->m_flags & (EXT4_MAP_MAPPED | EXT4_MAP_UNWRITTEN |
> > +				    EXT4_MAP_DELAYED))
> > +			return 0;
> > +	}
> > +
> > +	handle = ext4_journal_start(inode, EXT4_HT_MAP_BLOCKS,
> > +			ext4_chunk_trans_blocks(inode, map->m_len));
> > +	if (IS_ERR(handle))
> > +		return PTR_ERR(handle);
> > +
> > +	ret = ext4_map_blocks(handle, inode, map,
> > +			      EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT);
> > +	/*
> > +	 * Stop handle here following the lock ordering of the folio lock
> > +	 * and the transaction start.
> > +	 */
> > +	ext4_journal_stop(handle);
> > +
> > +	return ret;
> > +}
> > +
> > +static int ext4_iomap_buffered_do_write_begin(struct inode *inode,
> > +		loff_t offset, loff_t length, unsigned int flags,
> > +		struct iomap *iomap, struct iomap *srcmap, bool delalloc)
> > +{
> > +	int ret, retries = 0;
> > +	struct ext4_map_blocks map;
> > +	ext4_get_blocks_t *get_blocks;
> > +
> > +	ret = ext4_emergency_state(inode->i_sb);
> > +	if (unlikely(ret))
> > +		return ret;
> > +
> > +	/* Inline data and non-extent are not supported. */
> > +	if (WARN_ON_ONCE(ext4_has_inline_data(inode)))
> > +		return -ERANGE;
> > +	if (WARN_ON_ONCE(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
> > +		return -EINVAL;
> > +	if (WARN_ON_ONCE(!(flags & IOMAP_WRITE)))
> > +		return -EINVAL;
> > +
> > +	if (delalloc)
> > +		get_blocks = ext4_da_map_blocks;
> > +	else
> > +		get_blocks = ext4_iomap_get_blocks;
> > +retry:
> > +	ret = ext4_iomap_map_blocks(inode, offset, length, get_blocks, &map);
> > +	if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
> > +		goto retry;
> > +	if (ret < 0)
> > +		return ret;
> > +
> > +	ext4_set_iomap(inode, iomap, &map, offset, length, flags);
> > +	return 0;
> > +}
> > +
> > +static int ext4_iomap_buffered_write_begin(struct inode *inode,
> > +		loff_t offset, loff_t length, unsigned int flags,
> > +		struct iomap *iomap, struct iomap *srcmap)
> > +{
> > +	return ext4_iomap_buffered_do_write_begin(inode, offset, length, flags,
> > +						  iomap, srcmap, false);
> > +}
> > +
> > +static int ext4_iomap_buffered_da_write_begin(struct inode *inode,
> > +		loff_t offset, loff_t length, unsigned int flags,
> > +		struct iomap *iomap, struct iomap *srcmap)
> > +{
> > +	return ext4_iomap_buffered_do_write_begin(inode, offset, length, flags,
> > +						  iomap, srcmap, true);
> > +}
> > +
> > +/*
> > + * On write failure, drop the stale delayed allocation range and release
> > + * its reserved space for both start and end blocks. Otherwise, we may
> > + * leave a range of delayed extents covered by a clean folio, which can
> > + * result in inaccurate space reservation accounting.
> > + */
> > +static void ext4_iomap_punch_delalloc(struct inode *inode, loff_t offset,
> > +				     loff_t length, struct iomap *iomap)
> > +{
> > +	down_write(&EXT4_I(inode)->i_data_sem);
> > +	ext4_es_remove_extent(inode, offset >> inode->i_blkbits,
> > +			DIV_ROUND_UP_ULL(length, EXT4_BLOCK_SIZE(inode->i_sb)));
> > +	up_write(&EXT4_I(inode)->i_data_sem);
> > +}
> > +
> > +static int ext4_iomap_buffered_da_write_end(struct inode *inode, loff_t offset,
> > +					    loff_t length, ssize_t written,
> > +					    unsigned int flags,
> > +					    struct iomap *iomap)
> > +{
> > +	loff_t start_byte, end_byte;
> > +
> > +	/* If we didn't reserve the blocks, we're not allowed to punch them. */
> > +	if (iomap->type != IOMAP_DELALLOC || !(iomap->flags & IOMAP_F_NEW))
> > +		return 0;
> > +
> > +	/* Nothing to do if we've written the entire delalloc extent */
> > +	start_byte = iomap_last_written_block(inode, offset, written);
> > +	end_byte = round_up(offset + length, i_blocksize(inode));
> > +	if (start_byte >= end_byte)
> > +		return 0;
> > +
> > +	filemap_invalidate_lock(inode->i_mapping);
> > +	iomap_write_delalloc_release(inode, start_byte, end_byte, flags,
> > +				     iomap, ext4_iomap_punch_delalloc);
> > +	filemap_invalidate_unlock(inode->i_mapping);
> > +	return 0;
> > +}
> > +
> > +/*
> > + * Since we always allocate unwritten extents, there is no need for
> > + * iomap_end to clean up allocated blocks on a short write.
> > + */
> > +const struct iomap_ops ext4_iomap_buffered_write_ops = {
> > +	.iomap_begin = ext4_iomap_buffered_write_begin,
> > +};
> > +
> > +const struct iomap_ops ext4_iomap_buffered_da_write_ops = {
> > +	.iomap_begin = ext4_iomap_buffered_da_write_begin,
> > +	.iomap_end = ext4_iomap_buffered_da_write_end,
> > +};
> > +
> >  const struct iomap_ops ext4_iomap_buffered_read_ops = {
> >  	.iomap_begin = ext4_iomap_buffered_read_begin,
> >  };
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index 6a77db4d3124..9bc294b769db 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -104,9 +104,13 @@ static const struct fs_parameter_spec ext4_param_specs[];
> >   *   -> page lock -> i_data_sem (rw)
> >   *
> >   * buffered write path:
> > - * sb_start_write -> i_mutex -> mmap_lock
> > - * sb_start_write -> i_mutex -> transaction start -> page lock ->
> > - *   i_data_sem (rw)
> > + * sb_start_write -> i_rwsem (w) -> mmap_lock
> > + * - buffer_head path:
> > + *   sb_start_write -> i_rwsem (w) -> transaction start -> folio lock ->
> > + *     i_data_sem (rw)
> > + * - iomap path:
> > + *   sb_start_write -> i_rwsem (w) -> transaction start -> i_data_sem (rw)
> > + *   sb_start_write -> i_rwsem (w) -> folio lock (not under an active handle)
> >   *
> >   * truncate:
> >   * sb_start_write -> i_mutex -> invalidate_lock (w) -> i_mmap_rwsem (w) ->
> > -- 
> > 2.52.0
> > 
> 

^ permalink raw reply

* Re: [PATCH 17/34] jbd2: Convert jbd2_write_superblock() to bh_submit()
From: Theodore Tso @ 2026-05-28 15:37 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Jan Kara, Christian Brauner, Christoph Hellwig, linux-fsdevel,
	linux-ext4
In-Reply-To: <20260525171931.4144395-18-willy@infradead.org>

On Mon, May 25, 2026 at 06:19:10PM +0100, Matthew Wilcox (Oracle) wrote:
> Avoid an extra indirect function call by using bh_submit() instead of
> submit_bh().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: linux-ext4@vger.kernel.org

Acked-by: Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply

* Re: [PATCH 16/34] jbd2: Convert journal commit to bh_submit()
From: Theodore Tso @ 2026-05-28 15:36 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Jan Kara, Christian Brauner, Christoph Hellwig, linux-fsdevel,
	linux-ext4
In-Reply-To: <20260525171931.4144395-17-willy@infradead.org>

On Mon, May 25, 2026 at 06:19:09PM +0100, Matthew Wilcox (Oracle) wrote:
> Avoid an extra indirect function call by using bh_submit()
> instead of submit_bh() in journal_submit_commit_record()
> and jbd2_journal_commit_transaction().  These both use
> journal_end_buffer_io_sync(), so it's more straightforward to do them
> both at once.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: linux-ext4@vger.kernel.org

Acked-by: Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply

* Re: [PATCH 15/34] ext4: Convert ext4_commit_super() to bh_submit()
From: Theodore Tso @ 2026-05-28 15:09 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Jan Kara, Christian Brauner, Christoph Hellwig, linux-fsdevel,
	linux-ext4
In-Reply-To: <20260525171931.4144395-16-willy@infradead.org>

On Mon, May 25, 2026 at 06:19:08PM +0100, Matthew Wilcox (Oracle) wrote:
> Avoid an extra indirect function call by using bh_submit() instead of
> submit_bh().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: linux-ext4@vger.kernel.org

Acked-by: Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply

* (no subject)
From: Syzkaller syz-bot-8448545c66-w8mzv @ 2026-05-28 14:56 UTC (permalink / raw)
  To: eburkov, jack, linux-ext4, linux-kernel, tytso

Content-Type: multipart/mixed; boundary="===============0636582995431990448=="
MIME-Version: 1.0
To: eburkov@ptsecurity.com, jack@suse.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, tytso@mit.edu
From: "syzbot" <fuzzing.farm+b4c70f9f7908435cb4f7@ptsecurity.com>
Reply-To: 
Subject: [syzbot] INFO: task hung in do_get_write_access

--===============0636582995431990448==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

Hello,

syzbot found the following issue on:

HEAD commit:    100000000000 6.9.6
git tree:       https://github.com/torvalds/linux.git 6.9.6
console output: https://None.appspot.com/x/log.txt?x=16a08000000000
kernel config:  https://None.appspot.com/x/.config?x=31f7bb9bd056e52b
dashboard link: https://None.appspot.com/bug?extid=b4c70f9f7908435cb4f7
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: fuzzing.farm+b4c70f9f7908435cb4f7@ptsecurity.com

forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
INFO: task kworker/u8:2:32 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:2    state:D stack:24272 pid:32    tgid:32    ppid:2      flags:0x00004000
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 bit_wait_io+0x1b/0xf0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x63/0x170 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xe1/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 do_get_write_access+0x91c/0x1270 fs/jbd2/transaction.c:1111
 jbd2_journal_get_write_access+0x20a/0x2a0 fs/jbd2/transaction.c:1260
 __ext4_journal_get_write_access+0x6e/0x3e0 fs/ext4/ext4_jbd2.c:239
 ext4_mb_mark_context+0x1f3/0xe50 fs/ext4/mballoc.c:4005
 ext4_mb_mark_diskspace_used+0x461/0x990 fs/ext4/mballoc.c:4122
 ext4_mb_new_blocks+0x7fc/0x4cc0 fs/ext4/mballoc.c:6224
 ext4_ext_map_blocks+0x1ced/0x6180 fs/ext4/extents.c:4317
 ext4_map_blocks+0x654/0x1a20 fs/ext4/inode.c:623
 mpage_map_one_extent fs/ext4/inode.c:2163 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2216 [inline]
 ext4_do_writepages+0x1a62/0x35e0 fs/ext4/inode.c:2679
 ext4_writepages+0x34e/0x7a0 fs/ext4/inode.c:2768
 do_writepages+0x1ca/0x890 mm/page-writeback.c:2612
 __writeback_single_inode+0x157/0xee0 fs/fs-writeback.c:1650
 writeback_sb_inodes+0x5fb/0x1170 fs/fs-writeback.c:1941
 __writeback_inodes_wb+0x10d/0x300 fs/fs-writeback.c:2012
 wb_writeback+0x7b3/0xae0 fs/fs-writeback.c:2119
 wb_check_background_flush fs/fs-writeback.c:2189 [inline]
 wb_do_writeback fs/fs-writeback.c:2277 [inline]
 wb_workfn+0x8a1/0xf60 fs/fs-writeback.c:2304
 process_one_work+0x93e/0x1ab0 kernel/workqueue.c:3267
 process_scheduled_works kernel/workqueue.c:3348 [inline]
 worker_thread+0x6b9/0xf60 kernel/workqueue.c:3429
 kthread+0x2cc/0x3c0 kernel/kthread.c:388
 ret_from_fork+0x56/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task kworker/u8:3:41 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:3    state:D stack:24280 pid:41    tgid:41    ppid:2      flags:0x00004000
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 blk_mq_get_tag+0x5ec/0xb90 block/blk-mq-tag.c:187
 __blk_mq_alloc_requests+0x7eb/0x1e40 block/blk-mq.c:499
 blk_mq_get_new_requests block/blk-mq.c:2890 [inline]
 blk_mq_submit_bio+0x12b1/0x1f90 block/blk-mq.c:2988
 __submit_bio+0x89/0x250 block/blk-core.c:621
 __submit_bio_noacct_mq block/blk-core.c:700 [inline]
 submit_bio_noacct_nocheck+0x92f/0xcd0 block/blk-core.c:729
 submit_bio_noacct+0x278/0xff0 block/blk-core.c:839
 submit_bio+0xd5/0x480 block/blk-core.c:881
 ext4_io_submit+0xac/0x150 fs/ext4/page-io.c:378
 ext4_do_writepages+0xc8b/0x35e0 fs/ext4/inode.c:2636
 ext4_writepages+0x34e/0x7a0 fs/ext4/inode.c:2768
 do_writepages+0x1ca/0x890 mm/page-writeback.c:2612
 __writeback_single_inode+0x157/0xee0 fs/fs-writeback.c:1650
 writeback_sb_inodes+0x5fb/0x1170 fs/fs-writeback.c:1941
 __writeback_inodes_wb+0x10d/0x300 fs/fs-writeback.c:2012
 wb_writeback+0x7b3/0xae0 fs/fs-writeback.c:2119
 wb_check_background_flush fs/fs-writeback.c:2189 [inline]
 wb_do_writeback fs/fs-writeback.c:2277 [inline]
 wb_workfn+0x8a1/0xf60 fs/fs-writeback.c:2304
 process_one_work+0x93e/0x1ab0 kernel/workqueue.c:3267
 process_scheduled_works kernel/workqueue.c:3348 [inline]
 worker_thread+0x6b9/0xf60 kernel/workqueue.c:3429
 kthread+0x2cc/0x3c0 kernel/kthread.c:388
 ret_from_fork+0x56/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task jbd2/sda-8:58 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:jbd2/sda-8      state:D stack:26824 pid:58    tgid:58    ppid:2      flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 blk_mq_get_tag+0x5ec/0xb90 block/blk-mq-tag.c:187
 __blk_mq_alloc_requests+0x7eb/0x1e40 block/blk-mq.c:499
 blk_mq_get_new_requests block/blk-mq.c:2890 [inline]
 blk_mq_submit_bio+0x12b1/0x1f90 block/blk-mq.c:2988
 __submit_bio+0x89/0x250 block/blk-core.c:621
 __submit_bio_noacct_mq block/blk-core.c:700 [inline]
 submit_bio_noacct_nocheck+0x92f/0xcd0 block/blk-core.c:729
 submit_bio_noacct+0x278/0xff0 block/blk-core.c:839
 submit_bio+0xd5/0x480 block/blk-core.c:881
 submit_bh_wbc+0x579/0x740 fs/buffer.c:2804
 submit_bh+0x24/0x30 fs/buffer.c:2809
 jbd2_journal_commit_transaction+0x2cd8/0x6640 fs/jbd2/commit.c:731
 kjournald2+0x218/0x970 fs/jbd2/journal.c:201
 kthread+0x2cc/0x3c0 kernel/kthread.c:388
 ret_from_fork+0x56/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task systemd-journal:85 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:systemd-journal state:D stack:25008 pid:85    tgid:85    ppid:1      flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 bit_wait_io+0x1b/0xf0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x63/0x170 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xe1/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 do_get_write_access+0x91c/0x1270 fs/jbd2/transaction.c:1111
 jbd2_journal_get_write_access+0x20a/0x2a0 fs/jbd2/transaction.c:1260
 __ext4_journal_get_write_access+0x6e/0x3e0 fs/ext4/ext4_jbd2.c:239
 ext4_reserve_inode_write+0x144/0x280 fs/ext4/inode.c:5728
 __ext4_mark_inode_dirty+0x1b1/0x8b0 fs/ext4/inode.c:5902
 ext4_dirty_inode+0xe6/0x140 fs/ext4/inode.c:5939
 __mark_inode_dirty+0x1d5/0xda0 fs/fs-writeback.c:2477
 generic_update_time+0xd4/0x100 fs/inode.c:1907
 inode_update_time fs/inode.c:1920 [inline]
 __file_update_time fs/inode.c:2109 [inline]
 file_update_time+0x143/0x170 fs/inode.c:2139
 ext4_page_mkwrite+0x38c/0x17d0 fs/ext4/inode.c:6057
 do_page_mkwrite+0x195/0x3b0 mm/memory.c:3091
 wp_page_shared mm/memory.c:3478 [inline]
 do_wp_page+0x543/0x2a60 mm/memory.c:3628
 handle_pte_fault mm/memory.c:5316 [inline]
 __handle_mm_fault+0xcc8/0x26e0 mm/memory.c:5441
 handle_mm_fault+0x455/0xad0 mm/memory.c:5606
 do_user_addr_fault+0x504/0x1130 arch/x86/mm/fault.c:1331
 handle_page_fault arch/x86/mm/fault.c:1474 [inline]
 exc_page_fault+0x5e/0xe0 arch/x86/mm/fault.c:1532
 _ZN2PT3LLD9Shellcode14HyperTransportL21splice_exc_page_faultEPNS2_7pt_regsEm+0x43/0x50 root/lld/kernel/linux/shellcode/driver/communication/page_fault_hook.cpp:28 [ptsb]
 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f3b9ba7e419
RSP: 002b:00007fffe6506800 EFLAGS: 00010246
RAX: 00007f3b997e7308 RBX: 000055d8e08bfb00 RCX: 00007f3b9baeb7e0
RDX: 00007f3b9baeb200 RSI: 00007fffe65067a8 RDI: 000055d8e08c6e40
RBP: 000055d8e08c6790 R08: 0000000000600ea8 R09: 000000000012c308
R10: 0000000000000002 R11: 0000000000223fe6 R12: 0000000000000024
R13: 00000000000324d0 R14: 0000000000000000 R15: 00007fffe6506820
 </TASK>
INFO: task rs:main Q:Reg:141 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:rs:main Q:Reg   state:D stack:26808 pid:141   tgid:136   ppid:1      flags:0x00000000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 bit_wait_io+0x1b/0xf0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x63/0x170 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xe1/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 do_get_write_access+0x91c/0x1270 fs/jbd2/transaction.c:1111
 jbd2_journal_get_write_access+0x20a/0x2a0 fs/jbd2/transaction.c:1260
 __ext4_journal_get_write_access+0x6e/0x3e0 fs/ext4/ext4_jbd2.c:239
 ext4_reserve_inode_write+0x144/0x280 fs/ext4/inode.c:5728
 __ext4_mark_inode_dirty+0x1b1/0x8b0 fs/ext4/inode.c:5902
 ext4_dirty_inode+0xe6/0x140 fs/ext4/inode.c:5939
 __mark_inode_dirty+0x1d5/0xda0 fs/fs-writeback.c:2477
 generic_update_time+0xd4/0x100 fs/inode.c:1907
 inode_update_time fs/inode.c:1920 [inline]
 __file_update_time fs/inode.c:2109 [inline]
 file_modified_flags fs/inode.c:2180 [inline]
 file_modified+0x1b7/0x1f0 fs/inode.c:2196
 ext4_write_checks fs/ext4/file.c:279 [inline]
 ext4_buffered_write_iter+0x107/0x3f0 fs/ext4/file.c:295
 ext4_file_write_iter+0x390/0x1900 fs/ext4/file.c:698
 call_write_iter include/linux/fs.h:2110 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0x786/0x1350 fs/read_write.c:590
 _ZN2PT3LLD9ShellcodeL16splice_vfs_writeEP4filePKcmPx+0x57/0x200 root/lld/kernel/linux/shellcode/driver/plugins/filetracer.cpp:363 [ptsb]
 ksys_write+0x155/0x290 fs/read_write.c:643
 __do_sys_write fs/read_write.c:655 [inline]
 __se_sys_write fs/read_write.c:652 [inline]
 __x64_sys_write+0x77/0xb0 fs/read_write.c:652
 _ZN2PT3LLD9ShellcodeL16SysSpliceGenericEPK7pt_regsPFlS4_ERKNS1_11syscall_dscE root/lld/kernel/linux/shellcode/driver/plugins/syscalls.cpp:395 [inline] [ptsb]
 _ZN2PT3LLD9ShellcodeL24splice_syscall_x64_writeEPK7pt_regs+0x51/0x60 root/lld/kernel/linux/shellcode/driver/plugins/syscalls.cpp:587 [ptsb]
 x64_sys_call+0x1e65/0x1f10 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xbf/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd394ee9fef
RSP: 002b:00007fd38fffe830 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000088 RCX: 00007fd394ee9fef
RDX: 0000000000001000 RSI: 00007fd384024260 RDI: 0000000000000009
RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 00007fd384024260
R13: 0000000000000000 R14: 0000000000000088 R15: 00007fd384023fa0
 </TASK>
INFO: task syz-executor:209 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor    state:D stack:26264 pid:209   tgid:209   ppid:203    flags:0x00000002
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 bit_wait_io+0x1b/0xf0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x63/0x170 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xe1/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 do_get_write_access+0x91c/0x1270 fs/jbd2/transaction.c:1111
 jbd2_journal_get_write_access+0x20a/0x2a0 fs/jbd2/transaction.c:1260
 __ext4_journal_get_write_access+0x6e/0x3e0 fs/ext4/ext4_jbd2.c:239
 ext4_reserve_inode_write+0x144/0x280 fs/ext4/inode.c:5728
 __ext4_mark_inode_dirty+0x1b1/0x8b0 fs/ext4/inode.c:5902
 ext4_dirty_inode+0xe6/0x140 fs/ext4/inode.c:5939
 __mark_inode_dirty+0x1d5/0xda0 fs/fs-writeback.c:2477
 generic_update_time+0xd4/0x100 fs/inode.c:1907
 inode_update_time fs/inode.c:1920 [inline]
 __file_update_time fs/inode.c:2109 [inline]
 file_update_time+0x143/0x170 fs/inode.c:2139
 ext4_page_mkwrite+0x38c/0x17d0 fs/ext4/inode.c:6057
 do_page_mkwrite+0x195/0x3b0 mm/memory.c:3091
 do_shared_fault mm/memory.c:4966 [inline]
 do_fault mm/memory.c:5028 [inline]
 do_pte_missing mm/memory.c:3880 [inline]
 handle_pte_fault mm/memory.c:5300 [inline]
 __handle_mm_fault+0x12ef/0x26e0 mm/memory.c:5441
 handle_mm_fault+0x455/0xad0 mm/memory.c:5606
 do_user_addr_fault+0x396/0x1130 arch/x86/mm/fault.c:1382
 handle_page_fault arch/x86/mm/fault.c:1474 [inline]
 exc_page_fault+0x5e/0xe0 arch/x86/mm/fault.c:1532
 _ZN2PT3LLD9Shellcode14HyperTransportL21splice_exc_page_faultEPNS2_7pt_regsEm+0x43/0x50 root/lld/kernel/linux/shellcode/driver/communication/page_fault_hook.cpp:28 [ptsb]
 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f34896debad
RSP: 002b:00007ffe4422bb08 EFLAGS: 00010287
RAX: 00007f3484d93000 RBX: 0000555559d98d00 RCX: 000000000000003f
RDX: 000000000000005d RSI: 0000555559d9af30 RDI: 00007f3484d93000
RBP: 0000555559d97dc0 R08: 0000000000000007 R09: 0000555559d97f10
R10: 311dc10bb6075acf R11: 0000000000000202 R12: 0000000000000001
R13: 0000000000000000 R14: 00007ffe4422bb20 R15: 0000000000000000
 </TASK>
INFO: task syz-executor:218 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor    state:D stack:24672 pid:218   tgid:218   ppid:214    flags:0x00000000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 bit_wait_io+0x1b/0xf0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x63/0x170 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xe1/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 do_get_write_access+0x91c/0x1270 fs/jbd2/transaction.c:1111
 jbd2_journal_get_write_access+0x20a/0x2a0 fs/jbd2/transaction.c:1260
 __ext4_journal_get_write_access+0x6e/0x3e0 fs/ext4/ext4_jbd2.c:239
 __ext4_new_inode+0x1057/0x56f0 fs/ext4/ialloc.c:1088
 ext4_mkdir+0x2ab/0xbf0 fs/ext4/namei.c:3013
 vfs_mkdir+0x585/0x830 fs/namei.c:4123
 do_mkdirat+0x327/0x3d0 fs/namei.c:4146
 __do_sys_mkdirat fs/namei.c:4161 [inline]
 __se_sys_mkdirat fs/namei.c:4159 [inline]
 __x64_sys_mkdirat+0x11c/0x180 fs/namei.c:4159
 _ZN2PT3LLD9ShellcodeL16SysSpliceGenericEPK7pt_regsPFlS4_ERKNS1_11syscall_dscE root/lld/kernel/linux/shellcode/driver/plugins/syscalls.cpp:395 [inline] [ptsb]
 _ZN2PT3LLD9ShellcodeL26splice_syscall_x64_mkdiratEPK7pt_regs+0x51/0x60 root/lld/kernel/linux/shellcode/driver/plugins/syscalls.cpp:1679 [ptsb]
 x64_sys_call+0x1dff/0x1f10 arch/x86/include/generated/asm/syscalls_64.h:259
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xbf/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1ee7aab997
RSP: 002b:00007ffcd45a4bd8 EFLAGS: 00000206 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f1ee7b1fc1b RCX: 00007f1ee7aab997
RDX: 00000000000001ff RSI: 00007f1ee7b1fc1b RDI: 00000000ffffff9c
RBP: 00007f1ee7c65a38 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 000000000000000c
R13: 0000000000000003 R14: 0000000000000009 R15: 0000000000000000
 </TASK>
INFO: task kworker/u8:4:232 blocked for more than 143 seconds.
      Tainted: G           O       6.9.6 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:4    state:D stack:25208 pid:232   tgid:232   ppid:2      flags:0x00004000
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5409 [inline]
 __schedule+0xb9b/0x2d20 kernel/sched/core.c:6746
 __schedule_loop kernel/sched/core.c:6823 [inline]
 schedule+0xea/0x380 kernel/sched/core.c:6838
 io_schedule+0xca/0x150 kernel/sched/core.c:9044
 blk_mq_get_tag+0x5ec/0xb90 block/blk-mq-tag.c:187
 __blk_mq_alloc_requests+0x7eb/0x1e40 block/blk-mq.c:499
 blk_mq_get_new_requests block/blk-mq.c:2890 [inline]
 blk_mq_submit_bio+0x12b1/0x1f90 block/blk-mq.c:2988
 __submit_bio+0x89/0x250 block/blk-core.c:621
 __submit_bio_noacct_mq block/blk-core.c:700 [inline]
 submit_bio_noacct_nocheck+0x92f/0xcd0 block/blk-core.c:729
 submit_bio_noacct+0x278/0xff0 block/blk-core.c:839
 submit_bio+0xd5/0x480 block/blk-core.c:881
 ext4_io_submit fs/ext4/page-io.c:378 [inline]
 io_submit_add_bh fs/ext4/page-io.c:419 [inline]
 ext4_bio_write_folio+0x86c/0x13b0 fs/ext4/page-io.c:563
 mpage_submit_folio+0x1a8/0x290 fs/ext4/inode.c:1869
 mpage_process_page_bufs+0x3dc/0x8c0 fs/ext4/inode.c:1982
 mpage_prepare_extent_to_map+0xd74/0x1420 fs/ext4/inode.c:2490
 ext4_do_writepages+0xc72/0x35e0 fs/ext4/inode.c:2632
 ext4_writepages+0x34e/0x7a0 fs/ext4/inode.c:2768
 do_writepages+0x1ca/0x890 mm/page-writeback.c:2612
 __writeback_single_inode+0x157/0xee0 fs/fs-writeback.c:1650
 writeback_sb_inodes+0x5fb/0x1170 fs/fs-writeback.c:1941
 __writeback_inodes_wb+0x10d/0x300 fs/fs-writeback.c:2012
 wb_writeback+0x7b3/0xae0 fs/fs-writeback.c:2119
 wb_check_old_data_flush fs/fs-writeback.c:2223 [inline]
 wb_do_writeback fs/fs-writeback.c:2276 [inline]
 wb_workfn+0xa46/0xf60 fs/fs-writeback.c:2304
 process_one_work+0x93e/0x1ab0 kernel/workqueue.c:3267
 process_scheduled_works kernel/workqueue.c:3348 [inline]
 worker_thread+0x6b9/0xf60 kernel/workqueue.c:3429
 kthread+0x2cc/0x3c0 kernel/kthread.c:388
 ret_from_fork+0x56/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: lockdep is turned off.
forming flush request for buffer 0xffffc900006d4000, size: 288776
forming flush request for buffer 0xffffc900006d4000, size: 1680
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672
forming flush request for buffer 0xffffc900006d4000, size: 1672


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
--===============0636582995431990448==--

^ permalink raw reply

* Re: [PATCH] ext4: Use %pe to print PTR_ERR() in namei.c
From: Theodore Tso @ 2026-05-28 14:56 UTC (permalink / raw)
  To: Abdellah Ouhbi; +Cc: linux-ext4, linux-kernel, skhan, me, linux-kernel-mentees
In-Reply-To: <20260424152245.142308-1-abdououhbi1@gmail.com>

On Fri, Apr 24, 2026 at 04:22:45PM +0100, Abdellah Ouhbi wrote:
> Fix coccicheck warning
> ./namei.c:150:25-32: WARNING: Consider using %pe to print PTR_ERR()
> 
> Replace %ld with %pe and PTR_ERR(bh) with bh pointer.
> The %pe specifier automatically converts error pointers to
> human-readable error names instead of raw error codes.
> 
> Signed-off-by: Abdellah Ouhbi <abdououhbi1@gmail.com>

I've folded the three patches you had sent into a single commit.  For
this kind of cleanup, there's no reason to have separate patches for
each file.

Thanks,

						- Ted

^ permalink raw reply

* Re: [PATCH v10 00/22] fs-verity support for XFS with post EOF merkle tree
From: Andrey Albershteyn @ 2026-05-28 14:50 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Carlos Maiolino, Christoph Hellwig, Andrey Albershteyn, linux-xfs,
	fsverity, linux-fsdevel, ebiggers, linux-ext4, linux-f2fs-devel,
	linux-btrfs, linux-unionfs, djwong, david
In-Reply-To: <20260528-offiziell-luftleer-misswirtschaft-3503bda2ad70@brauner>

On 2026-05-28 14:20:08, Christian Brauner wrote:
> On Tue, May 26, 2026 at 12:19:43PM +0200, Carlos Maiolino wrote:
> > On Fri, May 22, 2026 at 02:07:57PM +0200, Christoph Hellwig wrote:
> > > On Fri, May 22, 2026 at 12:03:20PM +0200, Christian Brauner wrote:
> > > > > I was expecting this to come through xfs tree too if Eric and Christian
> > > > > agree.
> > > > 
> > > > You may take it through the xfs tree if there are no conflicts with
> > > > vfs-7.2.iomap. If there are I want to add the iomap changes into
> > > > vfs-7.2.iomap that you can pull in.
> > > 
> > > Merging the iomap bits through the iomap branch might make sense, given
> > > that iomap usually tends to see quite a bit of activity.
> > > 
> > 
> > That sounds good to me. If you want to go ahead and pull in the iomap
> > bits, do so, and give me a heads up when you do it so I'll pull your
> > branch locally.
> 
> Great, can the series please be resent based on current vfs-7.2.iomap
> then please? Because the iomap changes in this series don't apply
> cleanly on vfs-7.2.iomap so we already have merge conflicts...
> 

hmm do you mean this branch?
https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-7.2.iomap

patches 07..09 seems to apply cleanly. The only conflict I see is in
the overlayfs patch 03. This is because [1] (is in -rc5) is missing
in vfs-7.2.iomap.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/overlayfs/util.c?h=v7.1-rc5&id=0c8c88b8eb82a2a41bec5f17c076d6312dc40316

-- 
- Andrey


^ permalink raw reply

* Re: [PATCH v3 0/2] ext4: add hash Kunit tests and optimize str2hashbuf
From: Theodore Ts'o @ 2026-05-28 14:38 UTC (permalink / raw)
  To: Andreas Dilger, Baokun Li, Jan Kara, Ojaswin Mujoo,
	Ritesh Harjani, Zhang Yi, Guan-Chun Wu
  Cc: Theodore Ts'o, linux-ext4, linux-kernel, edward062254,
	visitorckw, david.laight.linux
In-Reply-To: <20260413065114.730231-1-409411716@gms.tku.edu.tw>


On Mon, 13 Apr 2026 14:51:12 +0800, Guan-Chun Wu wrote:
> This series adds Kunit tests for fs/ext4/hash.c and refactors
> the str2hashbuf_{signed,unsigned}() helpers.
> 
> Patch 1 adds test coverage for ext4fs_dirhash(), including the main
> hash variants and relevant edge cases.
> 
> Patch 2 simplifies the str2hashbuf helper implementation by processing
> input in 4-byte chunks and removing function-pointer dispatch. This also
> reduces overhead and shows roughly 2x improvement on longer inputs in
> local testing.
> 
> [...]

Applied, thanks!

[1/2] ext4: add Kunit coverage for directory hash computation
      commit: a4841d91a7f57d38d3a63c18b4ce68ee5e06829b
[2/2] ext4: improve str2hashbuf by processing 4-byte chunks and removing function pointers
      commit: d8c73397cc49362a88a57b67c11eff6e65b525e8

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply

* Re: [PATCH] ext4: Replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ()
From: Theodore Ts'o @ 2026-05-28 14:38 UTC (permalink / raw)
  To: Andreas Dilger, Ryota Sakamoto
  Cc: Theodore Ts'o, linux-ext4, linux-kernel
In-Reply-To: <20260127-fix-fs_ext4-memcmp-v1-1-5c269ae906b6@gmail.com>


On Tue, 27 Jan 2026 23:23:23 +0900, Ryota Sakamoto wrote:
> Replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ() to improve
> debugging that prints the hex dump of the buffers when the assertion fails,
> whereas memcmp() only returns an integer difference.

Applied, thanks!

[1/1] ext4: Replace KUnit tests for memcmp() with KUNIT_ASSERT_MEMEQ()
      commit: eef9fb4e19bf99252232339183ee167c63457c57

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply

* Re: [PATCH v10 00/22] fs-verity support for XFS with post EOF merkle tree
From: Andrey Albershteyn @ 2026-05-28 14:25 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Carlos Maiolino, Christoph Hellwig, Andrey Albershteyn, linux-xfs,
	fsverity, linux-fsdevel, ebiggers, linux-ext4, linux-f2fs-devel,
	linux-btrfs, linux-unionfs, djwong, david
In-Reply-To: <20260528-offiziell-luftleer-misswirtschaft-3503bda2ad70@brauner>

On 2026-05-28 14:20:08, Christian Brauner wrote:
> On Tue, May 26, 2026 at 12:19:43PM +0200, Carlos Maiolino wrote:
> > On Fri, May 22, 2026 at 02:07:57PM +0200, Christoph Hellwig wrote:
> > > On Fri, May 22, 2026 at 12:03:20PM +0200, Christian Brauner wrote:
> > > > > I was expecting this to come through xfs tree too if Eric and Christian
> > > > > agree.
> > > > 
> > > > You may take it through the xfs tree if there are no conflicts with
> > > > vfs-7.2.iomap. If there are I want to add the iomap changes into
> > > > vfs-7.2.iomap that you can pull in.
> > > 
> > > Merging the iomap bits through the iomap branch might make sense, given
> > > that iomap usually tends to see quite a bit of activity.
> > > 
> > 
> > That sounds good to me. If you want to go ahead and pull in the iomap
> > bits, do so, and give me a heads up when you do it so I'll pull your
> > branch locally.
> 
> Great, can the series please be resent based on current vfs-7.2.iomap
> then please? Because the iomap changes in this series don't apply
> cleanly on vfs-7.2.iomap so we already have merge conflicts...
> 

Sure, I will resend soon.

-- 
- Andrey


^ permalink raw reply

* Re: [PATCH v4 18/23] ext4: wait for ordered I/O in the iomap buffered I/O path
From: Ojaswin Mujoo @ 2026-05-28 13:34 UTC (permalink / raw)
  To: Zhang Yi
  Cc: linux-ext4, linux-fsdevel, linux-kernel, tytso, adilger.kernel,
	libaokun, jack, ritesh.list, djwong, hch, yi.zhang, yizhang089,
	yangerkun, yukuai
In-Reply-To: <ahcUeq_IA_X988Ca@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>

On Wed, May 27, 2026 at 09:28:28PM +0530, Ojaswin Mujoo wrote:
> On Mon, May 11, 2026 at 03:23:38PM +0800, Zhang Yi wrote:
> > From: Zhang Yi <yi.zhang@huawei.com>
> > 
> > For append writes, wait for ordered I/O to complete before updating
> > i_disksize. This ensures that zeroed data is flushed to disk before the
> > metadata update, preventing stale data from being exposed during
> > unaligned post-EOF append writes.
> > 
> > Suggested-by: Jan Kara <jack@suse.cz>
> > Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
> > ---
> >  fs/ext4/ext4.h    | 11 +++++++
> >  fs/ext4/inode.c   | 80 ++++++++++++++++++++++++++++++++++++++++++-----
> >  fs/ext4/page-io.c | 60 +++++++++++++++++++++++++++++++++++
> >  fs/ext4/super.c   | 23 ++++++++++----
> >  4 files changed, 161 insertions(+), 13 deletions(-)
> > 
> > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > index 078feda47e36..9ce2128eea3e 100644
> > --- a/fs/ext4/ext4.h
> > +++ b/fs/ext4/ext4.h
> > @@ -1195,6 +1195,15 @@ struct ext4_inode_info {
> >  #ifdef CONFIG_FS_ENCRYPTION
> >  	struct fscrypt_inode_info *i_crypt_info;
> >  #endif
> > +
> > +	/*
> > +	 * Track ordered zeroed data during post-EOF append writes, fallocate,
> > +	 * and truncate-up operations. These parameters are used only in the
> > +	 * iomap buffered I/O path.
> > +	 */
> > +	ext4_lblk_t i_ordered_lblk;
> > +	ext4_lblk_t i_ordered_len;
> > +	wait_queue_head_t i_ordered_wq;
> >  };
> >  
> >  /*
> > @@ -3858,6 +3867,8 @@ extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
> >  			     __u64 len, __u64 *moved_len);
> >  
> >  /* page-io.c */
> > +#define EXT4_IOMAP_IOEND_ORDER_IO	1UL	/* This I/O is an ordered one */
> > +
> >  extern int __init ext4_init_pageio(void);
> >  extern void ext4_exit_pageio(void);
> >  extern ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags);
> > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> > index e013aeb03d7b..11fb369efeb1 100644
> > --- a/fs/ext4/inode.c
> > +++ b/fs/ext4/inode.c
> > @@ -4345,6 +4345,7 @@ static int ext4_iomap_writeback_submit(struct iomap_writepage_ctx *wpc,
> >  {
> >  	struct iomap_ioend *ioend = wpc->wb_ctx;
> >  	struct ext4_inode_info *ei = EXT4_I(ioend->io_inode);
> > +	ext4_lblk_t start, end, order_lblk, order_len;
> >  
> >  	/*
> >  	 * After I/O completion, a worker needs to be scheduled when:
> > @@ -4357,6 +4358,30 @@ static int ext4_iomap_writeback_submit(struct iomap_writepage_ctx *wpc,
> >  	    test_opt(ioend->io_inode->i_sb, DATA_ERR_ABORT))
> >  		ioend->io_bio.bi_end_io = ext4_iomap_end_bio;
> >  
> > +	/*
> > +	 * Mark the I/O as ordered. Ordered I/O requires separate endio
> > +	 * handling and must not be merged with regular I/O operations.
> > +	 */
> > +	order_len = READ_ONCE(ei->i_ordered_len);
> > +	if (order_len) {
> > +		/*
> > +		 * Pair with smp_store_release() in ext4_block_zero_eof().
> > +		 * Ensure we see the updated i_ordered_lblk that was written
> > +		 * before the release store to i_ordered_len.
> > +		 */
> > +		smp_rmb();
> > +		order_lblk = READ_ONCE(ei->i_ordered_lblk);
> > +		start = ioend->io_offset >> ioend->io_inode->i_blkbits;
> > +		end = EXT4_B_TO_LBLK(ioend->io_inode,
> > +				     ioend->io_offset + ioend->io_size);
> > +
> > +		if (start <= order_lblk && end >= order_lblk + order_len) {
> 
> Hi Zhang,
> 
> I guess this check is enough cause ordered_lblk and ordered_len will
> always be  contained in a single block.
> 
> > +			ioend->io_bio.bi_end_io = ext4_iomap_end_bio;
> > +			ioend->io_private = (void *)EXT4_IOMAP_IOEND_ORDER_IO;
> > +			ioend->io_flags |= IOMAP_IOEND_BOUNDARY;
> 
> FWIU, we are wanting the ordered IO to not be merged and submitted asap
> since we want to wake up the waiters. Is there any other reason?
> 
> Adding the boundary in ->writeback_submit() only affects
> iomap_ioend_can_merge() which happens after we have woken up the waiters
> and deferred the IO to the wq. We ideally want it affect
> iomap_can_add_to_ioend() ie we need to add IOMAP_F_BOUNDARY in
> ->writeback_range().
> 
> Secondly, I don't think boundary is the right flag here. It ensures
> that everything before the ordered iomap gets submitted and the ordered
> iomap starts a new ioend. This can still keep getting merged with the
> newer ioends untils we decide to submit the IO, which can delay waking
> up the waiters. If we really want the "no merge" behavior, we'll have to
> do something like [1] (Check the 2 NOMERGE flag patches).

Hi Zhang, forgot to add this.

[1] https://github.com/OjaswinM/linux/commits/iomap-buffered-atomic-rfc2.3/

Also some more comments below:
> 
> > +		}
> > +	}
> > +
> >  	return iomap_ioend_writeback_submit(wpc, error);
> >  }
> >  
> > @@ -4746,8 +4771,10 @@ static int ext4_iomap_submit_zero_block(struct inode *inode,
> >  					loff_t from, loff_t end)
> >  {
> >  	struct address_space *mapping = inode->i_mapping;
> > +	struct ext4_inode_info *ei = EXT4_I(inode);
> >  	struct folio *folio;
> >  	bool do_submit = false;
> > +	int ret;
> >  
> >  	folio = filemap_lock_folio(mapping, from >> PAGE_SHIFT);
> >  	if (IS_ERR(folio))
> > @@ -4757,14 +4784,50 @@ static int ext4_iomap_submit_zero_block(struct inode *inode,
> >  	folio_wait_writeback(folio);
> >  	WARN_ON_ONCE(folio_test_writeback(folio));
> >  
> > -	if (likely(folio_test_dirty(folio)))
> > +	/*
> > +	 * Mark the ordered range. It will be cleared upon I/O completion
> > +	 * in ext4_iomap_end_bio(). Any operation that extends i_disksize
> > +	 * (including append write end io past the zeroed boundary,
> > +	 * truncate up and append fallocate) must wait for this I/O to
> > +	 * complete before updating i_disksize.
> > +	 *
> > +	 * When multiple overlapping unaligned EOF writes are in flight, we
> > +	 * only need to track and wait for the first one. Subsequent writes
> > +	 * will zero the gap in memory and ensure that the zeroed data is
> > +	 * written out along with the valid data in the same block before
> > +	 * i_disksize is updated.
> > +	 */
> > +	if (likely(folio_test_dirty(folio) &&
> > +		   READ_ONCE(ei->i_ordered_len) == 0)) {
> > +		WRITE_ONCE(ei->i_ordered_lblk,
> > +			   from >> inode->i_blkbits);
> > +		/*
> > +		 * Pairs with smp_rmb() in ext4_iomap_writeback_submit()
> > +		 * and ext4_iomap_wb_ordered_wait(). Ensure the updated
> > +		 * i_ordered_lblk is visible when i_ordered_len becomes
> > +		 * non-zero.
> > +		 */
> > +		smp_store_release(&ei->i_ordered_len, 1);
> >  		do_submit = true;
> > +	}
> >  	folio_unlock(folio);
> >  	folio_put(folio);
> >  
> >  	/* Submit zeroed block. */
> > -	if (do_submit)
> > -		return filemap_fdatawrite_range(mapping, from, end - 1);
> > +	if (do_submit) {
> > +		ret = filemap_fdatawrite_range(mapping, from, end - 1);
> > +		if (ret) {
> > +			/*
> > +			 * Pairs with wait_event() in
> > +			 * ext4_iomap_wb_ordered_wait(). Ensure
> > +			 * i_ordered_len = 0 is visible before waking up
> > +			 * waiters.
> > +			 */
> > +			smp_store_release(&ei->i_ordered_len, 0);
> > +			wake_up_all(&ei->i_ordered_wq);
> > +			return ret;

Okay so even if the ordered IO fails we still let the i_disksize updates
go ahead? I think this is a deviation from the current behavior where we
abort the journal. If this is acceptable we should atleast add a comment
on why its okay.

> > +		}
> > +	}
> >  	return 0;
> >  }
> >  
> > @@ -4827,10 +4890,13 @@ int ext4_block_zero_eof(struct inode *inode, loff_t from, loff_t end)
> >  		 * data=ordered mode. We submit zeroed range directly here.
> >  		 * Do not wait for I/O completion for performance.
> >  		 *
> > -		 * TODO: Any operation that extends i_disksize (including
> > -		 * append write end io past the zeroed boundary, truncate up,
> > -		 * and append fallocate) must wait for the relevant I/O to
> > -		 * complete before updating i_disksize.
> > +		 * The end_io handler ext4_iomap_wb_ordered_wait() will wait
> > +		 * for I/O completion before updating i_disksize if the write
> > +		 * extends beyond the zeroed boundary.
> > +		 *
> > +		 * TODO: Any other operation that extends i_disksize
> > +		 * (including truncate up and append fallocate) must wait for
> > +		 * the relevant I/O to complete before updating i_disksize.
> >  		 */
> >  		} else if (ext4_inode_buffered_iomap(inode)) {
> >  			err = ext4_iomap_submit_zero_block(inode, from, end);
> > diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> > index 3050c887329f..ad05ebb49bf6 100644
> > --- a/fs/ext4/page-io.c
> > +++ b/fs/ext4/page-io.c
> > @@ -613,6 +613,46 @@ int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *folio,
> >  	return 0;
> >  }
> >  
> > +/*
> > + * If the old disk size is not block size aligned and the current
> > + * writeback range is entirely beyond the old EOF block, we should
> > + * wait for the zeroed data written in ext4_block_zero_eof() to be
> > + * written out, otherwise, it may expose stale data in that block.
> > + */
> > +static void ext4_iomap_wb_ordered_wait(struct inode *inode,
> > +				       loff_t pos, loff_t end)
> > +{
> > +	struct ext4_inode_info *ei = EXT4_I(inode);
> > +	unsigned int blocksize = i_blocksize(inode);
> > +	loff_t disksize = READ_ONCE(ei->i_disksize);
> > +	ext4_lblk_t order_lblk, order_len;
> > +
> > +	/*
> > +	 * Waiting for ordered I/O is unnecessary when:
> > +	 * - The on-disk size is block-aligned (no stale data exists).
> > +	 * - The write start is within the block of the old EOF
> > +	 *   (overwriting, or appending to a block that already contains
> > +	 *   valid data).
> > +	 */
> > +	if (!(disksize & (blocksize - 1)) ||
> > +	    pos < round_up(disksize, blocksize))
> > +		return;

Okay these checks are pretty confusing. I was intially thinking that
i_disksize's block would always be equal to i_ordered_lblk but seems
like that is not true because ext4_block_zero_eof() uses from=i_size.

So we could have a sequence where

1. truncate 4k (i_disksize = i_size = 4k)
2. write 8k,10k (i_disksize = 4k i_size = 10k, i_ordered_len = 0 (old isisze  is block aligned)) 
3. write 16k,18k (i_disksize = 4k i_size = 10k, i_ordered_len = 1, lblk=4)

Here we issue ordered IO even though it' probably not needed.  Now if
write 3 finishes first we see disksize as 4k so we don't wait for
ordered write. Which seems okay since we don't risk any stale data
exposure. However, this flow is pretty confuing.

Can't we somehow avoid having to issue/set ordered len/lblk in case it
is not really needed, like only issue it if i_disksize (and not i_size) 
is unaligned. That can simplify some of our check and avoid extra IO
overhead.

> > +
> > +	order_len = READ_ONCE(ei->i_ordered_len);
> > +	if (!order_len)
> > +		return;
> > +
> > +	/*
> > +	 * Pair with smp_store_release() in ext4_iomap_end_bio() and
> > +	 * ext4_block_zero_eof(). Ensure we see the updated i_ordered_lblk
> > +	 * that was written before the release store to i_ordered_len.
> > +	 */
> > +	smp_rmb();
> > +	order_lblk = READ_ONCE(ei->i_ordered_lblk);
> > +	if ((pos >> inode->i_blkbits) >= order_lblk + order_len)
> > +		wait_event(ei->i_ordered_wq, READ_ONCE(ei->i_ordered_len) == 0);
> > +}
> > +
> >  static int ext4_iomap_wb_update_disksize(handle_t *handle, struct inode *inode,
> >  					 loff_t end)
> >  {
> > @@ -656,6 +696,9 @@ static void ext4_iomap_finish_ioend(struct iomap_ioend *ioend)
> >  		goto out;
> >  	}
> >  
> > +	/* Wait ordered zero data to be written out. */
> > +	ext4_iomap_wb_ordered_wait(inode, pos, pos + size);
> > +
> >  	/* We may need to convert one extent and dirty the inode. */
> >  	credits = ext4_chunk_trans_blocks(inode,
> >  			EXT4_MAX_BLOCKS(size, pos, inode->i_blkbits));
> > @@ -717,8 +760,25 @@ void ext4_iomap_end_bio(struct bio *bio)
> >  	struct inode *inode = ioend->io_inode;
> >  	struct ext4_inode_info *ei = EXT4_I(inode);
> >  	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
> > +	unsigned long io_mode = (unsigned long)ioend->io_private;
> >  	unsigned long flags;
> >  
> > +	/*
> > +	 * This is an ordered I/O, clear the ordered range set in
> > +	 * ext4_block_zero_eof() and wake up all waiters that will update
> > +	 * the inode i_disksize.
> > +	 */
> > +	if (io_mode == EXT4_IOMAP_IOEND_ORDER_IO) {
> > +		/*
> > +		 * Pairs with wait_event() in ext4_iomap_wb_ordered_wait().
> > +		 * Ensure i_ordered_len = 0 is visible before waking up
> > +		 * waiters.
> > +		 */
> > +		smp_store_release(&ei->i_ordered_len, 0);
> > +		wake_up_all(&ei->i_ordered_wq);
> > +		goto defer;
> > +	}
> > +
> >  	/* Needs to convert unwritten extents or update the i_disksize. */
> >  	if ((ioend->io_flags & IOMAP_IOEND_UNWRITTEN) ||
> >  	    ioend->io_offset + ioend->io_size > READ_ONCE(ei->i_disksize))
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index 62bfe05a64bc..9c0a00e716f3 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -1444,6 +1444,9 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
> >  	ext4_fc_init_inode(&ei->vfs_inode);
> >  	spin_lock_init(&ei->i_fc_lock);
> >  	mmb_init(&ei->i_metadata_bhs, &ei->vfs_inode.i_data);
> > +	ei->i_ordered_lblk = 0;
> > +	ei->i_ordered_len = 0;
> > +	init_waitqueue_head(&ei->i_ordered_wq);
> >  	return &ei->vfs_inode;
> >  }
> >  
> > @@ -1480,12 +1483,20 @@ static void ext4_destroy_inode(struct inode *inode)
> >  		dump_stack();
> >  	}
> >  
> > -	if (!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ERROR_FS) &&
> > -	    WARN_ON_ONCE(EXT4_I(inode)->i_reserved_data_blocks))
> > -		ext4_msg(inode->i_sb, KERN_ERR,
> > -			 "Inode %llu (%p): i_reserved_data_blocks (%u) not cleared!",
> > -			 inode->i_ino, EXT4_I(inode),
> > -			 EXT4_I(inode)->i_reserved_data_blocks);
> > +	if (!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ERROR_FS)) {
> > +		if (WARN_ON_ONCE(EXT4_I(inode)->i_reserved_data_blocks))
> > +			ext4_msg(inode->i_sb, KERN_ERR,
> > +				 "Inode %llu (%p): i_reserved_data_blocks (%u) not cleared!",
> > +				 inode->i_ino, EXT4_I(inode),
> > +				 EXT4_I(inode)->i_reserved_data_blocks);
> > +
> > +		if (WARN_ON_ONCE(EXT4_I(inode)->i_ordered_len))
> > +			ext4_msg(inode->i_sb, KERN_ERR,
> > +				 "Inode %llu (%p): i_ordered_lblk (%u) and i_ordered_len (%u) not cleared!",
> > +				 inode->i_ino, EXT4_I(inode),
> > +				 EXT4_I(inode)->i_ordered_lblk,
> > +				 EXT4_I(inode)->i_ordered_len);
> > +	}
> >  }
> >  
> >  static void ext4_shutdown(struct super_block *sb)
> > -- 
> > 2.52.0
> > 

^ permalink raw reply

* Re: [PATCH 0/4] fs: mark selected blocking waits as freezable
From: Christian Brauner @ 2026-05-28 12:51 UTC (permalink / raw)
  To: linux-fsdevel, viro, tytso, jack, linux-ext4, Dai Junbing
  Cc: jack, linux-kernel
In-Reply-To: <20260527064912.1038-1-daijunbing@vivo.com>

On Wed, 27 May 2026 14:49:08 +0800, Dai Junbing wrote:
> fs: mark selected blocking waits as freezable
> 
> Hi,
> 
> During suspend and resume, tasks blocked in some interruptible wait
> paths may be unnecessarily woken due to freezer state transitions. This
> can introduce avoidable activity in the suspend/resume path.
> 
> [...]

Applied to the vfs-7.2.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.2.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.2.misc

[1/4] eventpoll: mark ep_poll() sleep as freezable
      https://git.kernel.org/vfs/vfs/c/f5437433c37d
[2/4] jbd2: make kjournald2 commit wait freezable
      https://git.kernel.org/vfs/vfs/c/10c6b259fb56
[3/4] pipe: mark blocking pipe read and FIFO open sleeps as freezable
      https://git.kernel.org/vfs/vfs/c/6e5e03a76bee
[4/4] select: make select() and poll() waits freezable
      https://git.kernel.org/vfs/vfs/c/f837c1dbd121


^ permalink raw reply

* Re: [PATCH v10 00/22] fs-verity support for XFS with post EOF merkle tree
From: Christian Brauner @ 2026-05-28 12:20 UTC (permalink / raw)
  To: Carlos Maiolino
  Cc: Christoph Hellwig, Andrey Albershteyn, Andrey Albershteyn,
	linux-xfs, fsverity, linux-fsdevel, ebiggers, linux-ext4,
	linux-f2fs-devel, linux-btrfs, linux-unionfs, djwong, david
In-Reply-To: <ahVzkf8JoKP-kSC2@nidhogg.toxiclabs.cc>

On Tue, May 26, 2026 at 12:19:43PM +0200, Carlos Maiolino wrote:
> On Fri, May 22, 2026 at 02:07:57PM +0200, Christoph Hellwig wrote:
> > On Fri, May 22, 2026 at 12:03:20PM +0200, Christian Brauner wrote:
> > > > I was expecting this to come through xfs tree too if Eric and Christian
> > > > agree.
> > > 
> > > You may take it through the xfs tree if there are no conflicts with
> > > vfs-7.2.iomap. If there are I want to add the iomap changes into
> > > vfs-7.2.iomap that you can pull in.
> > 
> > Merging the iomap bits through the iomap branch might make sense, given
> > that iomap usually tends to see quite a bit of activity.
> > 
> 
> That sounds good to me. If you want to go ahead and pull in the iomap
> bits, do so, and give me a heads up when you do it so I'll pull your
> branch locally.

Great, can the series please be resent based on current vfs-7.2.iomap
then please? Because the iomap changes in this series don't apply
cleanly on vfs-7.2.iomap so we already have merge conflicts...

^ permalink raw reply

* Re: [PATCH 2/8] ext4: convert mballoc KUnit test to sget_fc()
From: Christian Brauner @ 2026-05-28 12:02 UTC (permalink / raw)
  To: Theodore Tso
  Cc: linux-fsdevel, Andreas Dilger, Jan Kara, Ritesh Harjani (IBM),
	linux-ext4, linux-cifs, Alexander Viro
In-Reply-To: <ny6ggedljk3celsnnaaczpehmgll6hqrglqc44ku53cmxrclx5@w4qby54x6mff>

On Tue, May 26, 2026 at 07:47:27PM -0500, Theodore Ts'o wrote:
> On Tue, May 26, 2026 at 05:09:04PM +0200, Christian Brauner wrote:
> > Add a no-op mbt_init_fs_context() so fs_context_for_mount() has
> > something to call on the fake fs_type....
> 
> I was trying to figure out what needed to be in an init_fs_context()
> functrion, and I came accross this in
> Documentation/filesystems/mount_api.rst:
> 
>        const struct fs_context_operations *ops
> 
>      These are operations that can be done on a filesystem context (see
>      below).  This must be set by the ->init_fs_context() file_system_type
>      operation.    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> So is it safe to just have an init_fs_context() function which doesn't
> do this?


> 
> > +static int mbt_init_fs_context(struct fs_context *fc)
> > +{
> > +	return 0;
> > +}
> > +
> 
> I see in fs/fs_context.c that in some places the code protects against
> a NULL ops pointer:
> 
>         if (fc->need_free && fc->ops && fc->ops->free)
> 		fc->ops->free(fc);
> 
> But in other places, it doesn't and we'll end up derefrencing a null
> pointer:
> 
>         if (fc->ops->parse_param) {
> 		ret = fc->ops->parse_param(fc, param);
> 
> 	....
> 
> So it's unclear to me --- when is it safe (and not safe) to not bother
> to fill in the ops pointer?

Hey Ted!

In these two cases it's fine. Because you're just using the allocation
and deallocation functions to get a fs_context that's basically just an
empty vessel to get at a superblock via sget_fc() but you're not really
doing anything with it.

IOW, you can never end up in callchains that cause issues.

^ permalink raw reply

* Re: [PATCH 14/17] fs/namespace: use __getname() to allocate mntpath buffer
From: Christian Brauner @ 2026-05-28 11:54 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Jan Kara, Jan Kara, Mark Fasheh, Joel Becker, Joseph Qi,
	Ryusuke Konishi, Viacheslav Dubeyko, Trond Myklebust,
	Anna Schumaker, Chuck Lever, Jeff Layton, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Alexander Viro,
	Dave Kleikamp, Theodore Ts'o, Miklos Szeredi,
	Andreas Hindborg, Breno Leitao, Kees Cook, Tigran A. Aivazian,
	linux-kernel, linux-fsdevel, ocfs2-devel, linux-nilfs, linux-nfs,
	jfs-discussion, linux-ext4, linux-mm
In-Reply-To: <ahVisehwQGXEoM0g@kernel.org>

On Tue, May 26, 2026 at 12:06:57PM +0300, Mike Rapoport wrote:
> On Mon, May 25, 2026 at 06:22:13PM +0200, Jan Kara wrote:
> > On Sat 23-05-26 20:54:26, Mike Rapoport (Microsoft) wrote:
> > > mnt_warn_timestamp_expiry() allocates memory for a path with
> > > __get_free_page() although there is a dedicated helper for allocation of
> > > file paths: __getname().
> > > 
> > > Replace __get_free_page() for allocation of a path buffer with __getname().
> > > 
> > > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> > > ---
> > >  fs/namespace.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/namespace.c b/fs/namespace.c
> > > index fe919abd2f01..2ed9cd846a81 100644
> > > --- a/fs/namespace.c
> > > +++ b/fs/namespace.c
> > > @@ -3303,7 +3303,7 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,
> > >  	   (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) {
> > >  		char *buf, *mntpath;
> > >  
> > > -		buf = (char *)__get_free_page(GFP_KERNEL);
> > > +		buf = __getname();
> > 
> > Fair but d_path() below should then get PATH_MAX and not PAGE_SIZE.
> 
> Ack.
>  
> > >  		if (buf)
> > >  			mntpath = d_path(mountpoint, buf, PAGE_SIZE);
> > >  		else
> > > @@ -3319,7 +3319,7 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,
> > >  
> > >  		sb->s_iflags |= SB_I_TS_EXPIRY_WARNED;
> > >  		if (buf)
> > > -			free_page((unsigned long)buf);
> > > +			__putname(buf);
> > 
> > And __putname() is fine with NULL so no need for the if (buf) check here.
> 
> Will fix.

I've folded this myself.

^ permalink raw reply

* Re: [PATCH] ext4: Remove mention of PageWriteback
From: Jan Kara @ 2026-05-28 11:41 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Theodore Ts'o, Andreas Dilger, Baokun Li, Jan Kara,
	Ojaswin Mujoo, Ritesh Harjani (IBM), Zhang Yi, linux-ext4,
	linux-kernel
In-Reply-To: <20260526190805.341676-1-willy@infradead.org>

On Tue 26-05-26 20:08:02, Matthew Wilcox (Oracle) wrote:
> Update a comment to refer to the concept of writeback instead of the
> (now obsolete) detail of how it's implemented.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/page-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> index dc82e7b57e75..bc674aa4a656 100644
> --- a/fs/ext4/page-io.c
> +++ b/fs/ext4/page-io.c
> @@ -168,7 +168,7 @@ static void ext4_release_io_end(ext4_io_end_t *io_end)
>   * written. On IO failure, check if journal abort is needed. Note that
>   * we are protected from truncate touching same part of extent tree by the
>   * fact that truncate code waits for all DIO to finish (thus exclusion from
> - * direct IO is achieved) and also waits for PageWriteback bits. Thus we
> + * direct IO is achieved) and also waits for writeback to complete. Thus we
>   * cannot get to ext4_ext_truncate() before all IOs overlapping that range are
>   * completed (happens from ext4_free_ioend()).
>   */
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply

* Re: [PATCH 0/8] super: retire sget(), convert iterators to RCU
From: Jan Kara @ 2026-05-28 11:18 UTC (permalink / raw)
  To: Christian Brauner
  Cc: linux-fsdevel, Theodore Ts'o, Andreas Dilger, Jan Kara,
	Ritesh Harjani (IBM), linux-ext4, linux-cifs, Alexander Viro
In-Reply-To: <20260526-work-sget-v1-0-263f7025cedd@kernel.org>

On Tue 26-05-26 17:09:02, Christian Brauner wrote:
> * retire sget(): CIFS plus the two ext4 KUnit tests (extents-test,
>   mballoc-test) were the last in-tree callers, and all three convert
>   cleanly to sget_fc(). That lets sget() and its prototype come out,
>   taking ~60 lines that only existed to be kept in lockstep with
>   sget_fc() on every publish-path change.

This is definitely a good cleanup!

> * Walk @super_blocks and @type->fs_supers under RCU, pinned by
>   refcount_inc_not_zero(&sb->s_count). iterate_supers(),
>   iterate_supers_type(), user_get_super(), do_emergency_remount(),
>   filesystems_freeze() and filesystems_thaw() no longer hold sb_lock
>   across the cursor advance.
> 
>   The conversion goes in four small steps. Drop sb_lock from
>   setup_bdev_super(): the {s_bdev_file, s_bdev, s_bdi,
>   SB_I_STABLE_WRITES} tuple is publication of immutable state, and
>   SB_BORN already gates every reader via super_wake()'s
>   smp_store_release paired with super_flags()'s smp_load_acquire. Then
>   convert sb->s_count to refcount_t -- mechanical, every increment is
>   still under sb_lock. Then switch the write-side list/hlist ops to
>   their _rcu variants; @super_blocks gets list_bidir_del_rcu() so the
>   reverse-walking iterators (filesystems_freeze, do_emergency_remount)
>   keep a valid ->prev on the unlinked entry, matching the canonical
>   pattern in kernel/nstree.c. Finally, convert the iterators themselves:
>   cursor advance via READ_ONCE / rcu_dereference, with the previous
>   entry kept pinned via its s_count across the rcu_read_unlock ->
>   callback -> rcu_read_lock cycle.

So I guess the motivation for getting rid of sb_lock is some contention on
it you can observe? When exactly? It would be nice to mention the
motivation as a justification for the additional complexity...

								Honza

> 
> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
> ---
> Christian Brauner (8):
>       ext4: convert extents KUnit test to sget_fc()
>       ext4: convert mballoc KUnit test to sget_fc()
>       smb: client: convert cifs_smb3_do_mount() to sget_fc()
>       fs: retire sget()
>       super: drop sb_lock from setup_bdev_super() tuple publication
>       super: convert sb->s_count to refcount_t
>       super: switch list manipulation to _rcu primitives
>       super: convert iterators to RCU readers + refcount_inc_not_zero
> 
>  fs/btrfs/super.c               |   2 +-
>  fs/ext4/extents-test.c         |  22 +++++-
>  fs/ext4/mballoc-test.c         |  17 ++++-
>  fs/smb/client/cifsfs.c         |  43 ++++++-----
>  fs/smb/client/cifsfs.h         |   3 +-
>  fs/smb/client/cifsproto.h      |   3 +-
>  fs/smb/client/connect.c        |   5 +-
>  fs/smb/client/fs_context.c     |   2 +-
>  fs/super.c                     | 167 ++++++++++++++---------------------------
>  include/linux/fs.h             |   4 -
>  include/linux/fs/super_types.h |   3 +-
>  11 files changed, 127 insertions(+), 144 deletions(-)
> ---
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
> change-id: 20260526-work-sget-6bc80b96cba5
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply

* [PATCH] ext4: fix quota accounting WARN in bigalloc punch hole
From: Qiliang Yuan @ 2026-05-28 10:21 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Baokun Li, Jan Kara,
	Ojaswin Mujoo, Ritesh Harjani (IBM), Zhang Yi
  Cc: linux-ext4, linux-kernel, Zijing Yin, Qiliang Yuan

When doing direct I/O write on a bigalloc filesystem, the allocated
extent might not cover entire clusters at its boundaries, leaving
delayed blocks in those boundary clusters.  In ext4_es_insert_extent(),
__revise_pending() inserts new pending reservations for those boundary
clusters, and the return value (pending=true) was added to resv_used,
causing ext4_da_update_reserve_space() to incorrectly release the
quota reservations for those boundary clusters.

Later when PUNCH_HOLE removes the DIO-allocated blocks, the
extent removal path detects the pending reservation via
ext4_is_pending() and calls ext4_rereserve_cluster().  This tries
to reclaim quota from dq_dqb.dqb_curspace back to dqb_rsvspace,
but since the quota was already incorrectly released, dqb_curspace
is insufficient, triggering:

  WARNING at dquot_reclaim_space_nodirty+0x77c/0x8c0

The subsequent delalloc writeback then fires a second WARN from
dquot_claim_space_nodirty() for the same reason: dqb_rsvspace was
depleted by the earlier incorrect release.

__es_remove_extent() -> get_rsvd() already correctly excludes
boundary clusters that still contain delayed blocks from resv_used.
Adding pending to resv_used double-counts those boundary clusters,
erroneously releasing reservations that are still needed.

Remove the pending variable and the resv_used += pending addition.

Fixes: c543e2429640 ("ext4: update delalloc data reserve spcae in ext4_es_insert_extent()")
Reported-by: Zijing Yin <yzjaurora@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221570
Signed-off-by: Qiliang Yuan <realwujing@gmail.com>
---
 fs/ext4/extents_status.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 6e4a191e82191..fefe0bb8ac4d1 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -909,7 +909,7 @@ void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
 	struct extent_status newes;
 	ext4_lblk_t end = lblk + len - 1;
 	int err1 = 0, err2 = 0, err3 = 0;
-	int resv_used = 0, pending = 0;
+	int resv_used = 0;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	struct extent_status *es1 = NULL;
 	struct extent_status *es2 = NULL;
@@ -977,7 +977,6 @@ void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
 			__free_pending(pr);
 			pr = NULL;
 		}
-		pending = err3;
 	}
 	ext4_es_inc_seq(inode);
 error:
@@ -998,7 +997,6 @@ void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
 	 * any previously delayed allocated clusters instead of claim them
 	 * again.
 	 */
-	resv_used += pending;
 	if (resv_used)
 		ext4_da_update_reserve_space(inode, resv_used,
 					     delalloc_reserve_used);

---
base-commit: eb3f4b7426cfd2b79d65b7d37155480b32259a11
change-id: 20260528-fix-ext4-bigalloc-punch-hole-quota-v2-2adca315d1ba

Best regards,
-- 
Qiliang Yuan <realwujing@gmail.com>


^ permalink raw reply related

* Re: [PATCH v4] ext2: Remove deprecated DAX support
From: Ashwin Gundarapu @ 2026-05-28  8:26 UTC (permalink / raw)
  To: kernel test robot; +Cc: jack, oe-kbuild-all, linux-ext4, linux-kernel
In-Reply-To: <202605281203.e91xvDyr-lkp@intel.com>

This indentation warning is from pre-existing code (originally written in 2010) that my patch did not touch. I prefer to keep this patch focused solely on removing deprecated DAX support. A separate cleanup patch can be submitted later if desired.
Regards,
Ashwin Gundarapu

From: kernel test robot <lkp@intel.com>
To: "Ashwin Gundarapu"<linuxuser509@zohomail.in>, "jack"<jack@suse.com>
Cc: <oe-kbuild-all@lists.linux.dev>, "linux-ext4"<linux-ext4@vger.kernel.org>, "linux-kernel"<linux-kernel@vger.kernel.org>
Date: Thu, 28 May 2026 09:46:32 +0530
Subject: Re: [PATCH v4] ext2: Remove deprecated DAX support

 > Hi Ashwin, 
 >  
 > kernel test robot noticed the following build warnings: 
 >  
 > [auto build test WARNING on jack-fs/for_next] 
 > [also build test WARNING on linus/master v7.1-rc5 next-20260527] 
 > [If your patch is applied to the wrong git tree, kindly drop us a note. 
 > And when submitting patch, we suggest to use '--base' as documented in 
 > https://git-scm.com/docs/git-format-patch#_base_tree_information] 
 >  
 > url: https://github.com/intel-lab-lkp/linux/commits/Ashwin-Gundarapu/ext2-Remove-deprecated-DAX-support/20260524-233631 
 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git for_next 
 > patch link: https://lore.kernel.org/r/19e5aa07c9b.3a2e576d130187.5289857983023045470%40zohomail.in 
 > patch subject: [PATCH v4] ext2: Remove deprecated DAX support 
 > config: arm-randconfig-r071-20260528 (https://download.01.org/0day-ci/archive/20260528/202605281203.e91xvDyr-lkp@intel.com/config) 
 > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) 
 > smatch: v0.5.0-9185-gbcc58b9c 
 >  
 > If you fix the issue in a separate patch/commit (i.e. not just a new version of 
 > the same patch/commit), kindly add following tags 
 > | Reported-by: kernel test robot <lkp@intel.com> 
 > | Closes: https://lore.kernel.org/oe-kbuild-all/202605281203.e91xvDyr-lkp@intel.com/ 
 >  
 > smatch warnings: 
 > fs/ext2/inode.c:1251 ext2_setsize() warn: inconsistent indenting 
 >  
 > vim +1251 fs/ext2/inode.c 
 >  
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1236 
 > 2c27c65ed0696f0 Christoph Hellwig 2010-06-04  1237  static int ext2_setsize(struct inode *inode, loff_t newsize) 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1238  { 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1239      int error; 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1240 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1241      if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1242          S_ISLNK(inode->i_mode))) 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1243          return -EINVAL; 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1244      if (ext2_inode_is_fast_symlink(inode)) 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1245          return -EINVAL; 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1246      if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1247          return -EPERM; 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1248 
 > 562c72aa57c36b1 Christoph Hellwig 2011-06-24  1249      inode_dio_wait(inode); 
 > 562c72aa57c36b1 Christoph Hellwig 2011-06-24  1250 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27 @1251              error = block_truncate_page(inode->i_mapping, 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1252                                  newsize, ext2_get_block); 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1253      if (error) 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1254          return error; 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1255 
 > 70f3bad8c3154ba Jan Kara          2021-04-12  1256      filemap_invalidate_lock(inode->i_mapping); 
 > 2c27c65ed0696f0 Christoph Hellwig 2010-06-04  1257      truncate_setsize(inode, newsize); 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1258      __ext2_truncate_blocks(inode, newsize); 
 > 70f3bad8c3154ba Jan Kara          2021-04-12  1259      filemap_invalidate_unlock(inode->i_mapping); 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1260 
 > 5cdc59fce617a2e Jeff Layton       2023-10-04  1261      inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1262      if (inode_needs_sync(inode)) { 
 > b0439bbc29f0201 Jan Kara          2026-03-26  1263          mmb_sync(&EXT2_I(inode)->i_metadata_bhs); 
 > c37650161a53c01 Christoph Hellwig 2010-10-06  1264          sync_inode_metadata(inode, 1); 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1265      } else { 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1266          mark_inode_dirty(inode); 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1267      } 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1268 
 > 737f2e93b9724a3 Nicholas Piggin   2010-05-27  1269      return 0; 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1270  } 
 > ^1da177e4c3f415 Linus Torvalds    2005-04-16  1271 
 >  
 > -- 
 > 0-DAY CI Kernel Test Service 
 > https://github.com/intel/lkp-tests/wiki 
 >  
 > 


^ permalink raw reply

* Re: [PATCH v4] ext2: Remove deprecated DAX support
From: kernel test robot @ 2026-05-28  4:16 UTC (permalink / raw)
  To: Ashwin Gundarapu, jack; +Cc: oe-kbuild-all, linux-ext4, linux-kernel
In-Reply-To: <19e5aa07c9b.3a2e576d130187.5289857983023045470@zohomail.in>

Hi Ashwin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jack-fs/for_next]
[also build test WARNING on linus/master v7.1-rc5 next-20260527]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ashwin-Gundarapu/ext2-Remove-deprecated-DAX-support/20260524-233631
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git for_next
patch link:    https://lore.kernel.org/r/19e5aa07c9b.3a2e576d130187.5289857983023045470%40zohomail.in
patch subject: [PATCH v4] ext2: Remove deprecated DAX support
config: arm-randconfig-r071-20260528 (https://download.01.org/0day-ci/archive/20260528/202605281203.e91xvDyr-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605281203.e91xvDyr-lkp@intel.com/

smatch warnings:
fs/ext2/inode.c:1251 ext2_setsize() warn: inconsistent indenting

vim +1251 fs/ext2/inode.c

737f2e93b9724a3 Nicholas Piggin   2010-05-27  1236  
2c27c65ed0696f0 Christoph Hellwig 2010-06-04  1237  static int ext2_setsize(struct inode *inode, loff_t newsize)
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1238  {
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1239  	int error;
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1240  
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1241  	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1242  	    S_ISLNK(inode->i_mode)))
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1243  		return -EINVAL;
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1244  	if (ext2_inode_is_fast_symlink(inode))
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1245  		return -EINVAL;
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1246  	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1247  		return -EPERM;
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1248  
562c72aa57c36b1 Christoph Hellwig 2011-06-24  1249  	inode_dio_wait(inode);
562c72aa57c36b1 Christoph Hellwig 2011-06-24  1250  
737f2e93b9724a3 Nicholas Piggin   2010-05-27 @1251  			error = block_truncate_page(inode->i_mapping,
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1252  								newsize, ext2_get_block);
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1253  	if (error)
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1254  		return error;
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1255  
70f3bad8c3154ba Jan Kara          2021-04-12  1256  	filemap_invalidate_lock(inode->i_mapping);
2c27c65ed0696f0 Christoph Hellwig 2010-06-04  1257  	truncate_setsize(inode, newsize);
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1258  	__ext2_truncate_blocks(inode, newsize);
70f3bad8c3154ba Jan Kara          2021-04-12  1259  	filemap_invalidate_unlock(inode->i_mapping);
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1260  
5cdc59fce617a2e Jeff Layton       2023-10-04  1261  	inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
^1da177e4c3f415 Linus Torvalds    2005-04-16  1262  	if (inode_needs_sync(inode)) {
b0439bbc29f0201 Jan Kara          2026-03-26  1263  		mmb_sync(&EXT2_I(inode)->i_metadata_bhs);
c37650161a53c01 Christoph Hellwig 2010-10-06  1264  		sync_inode_metadata(inode, 1);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1265  	} else {
^1da177e4c3f415 Linus Torvalds    2005-04-16  1266  		mark_inode_dirty(inode);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1267  	}
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1268  
737f2e93b9724a3 Nicholas Piggin   2010-05-27  1269  	return 0;
^1da177e4c3f415 Linus Torvalds    2005-04-16  1270  }
^1da177e4c3f415 Linus Torvalds    2005-04-16  1271  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox