Test: [v5.15] INFO: task hung in jfs_commit_inode
From: Aditya Dutt
Date: Wed Jul 02 2025 - 14:25:04 EST
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-5.15.y
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 27ca98614b0b..cb57d4f1161f 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -835,6 +835,8 @@ int dtInsert(tid_t tid, struct inode *ip,
* the full page.
*/
DT_GETSEARCH(ip, btstack->top, bn, mp, p, index);
+ if (p->header.freelist == 0)
+ return -EINVAL;
/*
* insert entry for new key