Skip to content

Commit

Permalink
JFS: Check for invalid inodes in jfs_delete_inode
Browse files Browse the repository at this point in the history
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 <shaggy@austin.ibm.com>
  • Loading branch information
Dave Kleikamp committed Aug 1, 2005
1 parent da28c12 commit 30db1ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/jfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 30db1ae

Please sign in to comment.