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-Tag: v2.6.13-rc7~79^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30db1ae8640d3527ca7ac8df4bcbf14ccc6ae9cd;p=linux-2.6 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 2137138c59..767c7ecb42 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);