Showing error 998

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: fs/xfs/xfs_inode.c
Line in file: 2676
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:18 UTC


Source:

2646#ifdef XFS_RW_TRACE
2647        ktrace_free(ip->i_rwtrace);
2648#endif
2649#ifdef XFS_ILOCK_TRACE
2650        ktrace_free(ip->i_lock_trace);
2651#endif
2652#ifdef XFS_DIR2_TRACE
2653        ktrace_free(ip->i_dir_trace);
2654#endif
2655        if (ip->i_itemp) {
2656                /*
2657                 * Only if we are shutting down the fs will we see an
2658                 * inode still in the AIL. If it is there, we should remove
2659                 * it to prevent a use-after-free from occurring.
2660                 */
2661                xfs_mount_t        *mp = ip->i_mount;
2662                xfs_log_item_t        *lip = &ip->i_itemp->ili_item;
2663
2664                ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
2665                                       XFS_FORCED_SHUTDOWN(ip->i_mount));
2666                if (lip->li_flags & XFS_LI_IN_AIL) {
2667                        spin_lock(&mp->m_ail_lock);
2668                        if (lip->li_flags & XFS_LI_IN_AIL)
2669                                xfs_trans_delete_ail(mp, lip);
2670                        else
2671                                spin_unlock(&mp->m_ail_lock);
2672                }
2673                xfs_inode_item_destroy(ip);
2674        }
2675        kmem_zone_free(xfs_inode_zone, ip);
2676}
2677
2678
2679/*
2680 * Increment the pin count of the given buffer.
2681 * This value is protected by ipinlock spinlock in the mount structure.
2682 */
2683void
2684xfs_ipin(
2685        xfs_inode_t        *ip)
2686{
Show full sources