diff --git a/fs/inode.c b/fs/inode.c index a62032864ddf..e923f4303872 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(); @@ -1855,6 +1857,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);