Skip to contentSkip to conversation

ext4: free orphan info with kvfree

PATCH Applied Jan Kara 2 participants 2 messages Oct 7, 2025 – Oct 15, 2025

Subsystems (2)
lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 ext4: free orphan info with kvfree

Orphan info is now getting allocated with kvmalloc_array(). Free it with kvfree() instead of kfree() to avoid complaints from mm.

Fixes 0a6ce20c1564 ("ext4: verify orphan file size is not too big")
---
 fs/ext4/orphan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/orphan.c +2 -2
index 33c3a89396b1..82d5e7501455 100644
@@ -513,7 +513,7 @@ void ext4_release_orphan_info(struct super_block *sb)
 		return;
 	for (i = 0; i < oi->of_blocks; i++)
 		brelse(oi->of_binfo[i].ob_bh);
-	kfree(oi->of_binfo);
+	kvfree(oi->of_binfo);
 }
 
 static struct ext4_orphan_block_tail *ext4_orphan_block_tail(
@@ -637,7 +637,7 @@ int ext4_init_orphan_info(struct super_block *sb)
 out_free:
 	for (i--; i >= 0; i--)
 		brelse(oi->of_binfo[i].ob_bh);
-	kfree(oi->of_binfo);
+	kvfree(oi->of_binfo);
 out_put:
 	iput(inode);
 	return ret;
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Jan Kara

Orphan info is now getting allocated with kvmalloc_array(). Free it with kvfree() instead of kfree() to avoid complaints from mm.

Applied, thanks!

[1/1] ext4: free orphan info with kvfree

      commit: 971843c511c3c2f6eda96c6b03442913bfee6148

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>