From: Dave Kleikamp Date: Mon, 1 Aug 2005 21:54:26 +0000 (-0500) Subject: JFS: Check for invalid inodes in jfs_delete_inode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30db1ae8640d3527ca7ac8df4bcbf14ccc6ae9cd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git JFS: Check for invalid inodes in jfs_delete_inode Some error paths may iput an invalid inode with i_nlink=0. jfs should not try to actually delete such an inode. Signed-off-by: Dave Kleikamp --- diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 2137138c59b0..767c7ecb429e 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -128,6 +128,10 @@ void jfs_delete_inode(struct inode *inode) { jfs_info("In jfs_delete_inode, inode = 0x%p", inode); + if (is_bad_inode(inode) || + (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I))) + return; + if (test_cflag(COMMIT_Freewmap, inode)) jfs_free_zero_link(inode);