index a62032864ddf..7f4c74cc09b5 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1057,6 +1057,7 @@ static struct inode *find_inode(struct super_block *sb, __wait_on_freeing_inode(inode, is_inode_hash_locked); goto repeat; } + BUG_ON(inode_unhashed(inode)); if (unlikely(inode_state_read(inode) & I_CREATING)) { spin_unlock(&inode->i_lock); rcu_read_unlock(); @@ -1099,6 +1100,7 @@ static struct inode *find_inode_fast(struct super_block *sb, __wait_on_freeing_inode(inode, is_inode_hash_locked); goto repeat; } + BUG_ON(inode_unhashed(inode)); if (unlikely(inode_state_read(inode) & I_CREATING)) { spin_unlock(&inode->i_lock); rcu_read_unlock(); @@ -1318,6 +1320,8 @@ struct inode *inode_insert5(struct inode *inode, unsigned long hashval, iput(old); goto again; } + } else { + BUG_ON(inode_unhashed(old)); } return old; } @@ -1420,6 +1424,8 @@ struct inode *iget5_locked_rcu(struct super_block *sb, unsigned long hashval, iput(inode); goto again; } + } else { + BUG_ON(inode_unhashed(inode)); } return inode; } @@ -1466,6 +1472,8 @@ struct inode *iget_locked(struct super_block *sb, unsigned long ino) iput(inode); goto again; } + } else { + BUG_ON(inode_unhashed(inode)); } return inode; } @@ -1508,6 +1516,8 @@ struct inode *iget_locked(struct super_block *sb, unsigned long ino) iput(inode); goto again; } + } else { + BUG_ON(inode_unhashed(inode)); } } return inode; @@ -1655,6 +1665,8 @@ struct inode *ilookup5(struct super_block *sb, unsigned long hashval, iput(inode); goto again; } + } else { + BUG_ON(inode_unhashed(inode)); } } return inode; @@ -1689,6 +1701,8 @@ struct inode *ilookup(struct super_block *sb, unsigned long ino) iput(inode); goto again; } + } else { + BUG_ON(inode_unhashed(inode)); } } return inode; @@ -1855,6 +1869,7 @@ int insert_inode_locked(struct inode *inode) spin_unlock(&inode_hash_lock); return 0; } + BUG_ON(inode_unhashed(old)); if (unlikely(inode_state_read(old) & I_CREATING)) { spin_unlock(&old->i_lock); spin_unlock(&inode_hash_lock); @@ -1870,6 +1885,8 @@ int insert_inode_locked(struct inode *inode) iput(old); return -EBUSY; } + } else { + BUG_ON(inode_unhashed(old)); } iput(old); }