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_extfree_item.c |
Line in file: | 158 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-03-02 21:35:18 UTC |
128 * like unpin only we have to also clear the xaction descriptor 129 * pointing the log item if we free the item. This routine duplicates 130 * unpin because efi_flags is protected by the AIL lock. Freeing 131 * the descriptor and then calling unpin would force us to drop the AIL 132 * lock which would open up a race condition. 133 */ 134STATIC void 135xfs_efi_item_unpin_remove(xfs_efi_log_item_t *efip, xfs_trans_t *tp) 136{ 137 xfs_mount_t *mp; 138 xfs_log_item_desc_t *lidp; 139 140 mp = efip->efi_item.li_mountp; 141 spin_lock(&mp->m_ail_lock); 142 if (efip->efi_flags & XFS_EFI_CANCELED) { 143 /* 144 * free the xaction descriptor pointing to this item 145 */ 146 lidp = xfs_trans_find_item(tp, (xfs_log_item_t *) efip); 147 xfs_trans_free_item(tp, lidp); 148 /* 149 * pull the item off the AIL. 150 * xfs_trans_delete_ail() drops the AIL lock. 151 */ 152 xfs_trans_delete_ail(mp, (xfs_log_item_t *)efip); 153 xfs_efi_item_free(efip); 154 } else { 155 efip->efi_flags |= XFS_EFI_COMMITTED; 156 spin_unlock(&mp->m_ail_lock); 157 } 158} 159 160/* 161 * Efi items have no locking or pushing. However, since EFIs are 162 * pulled from the AIL when their corresponding EFDs are committed 163 * to disk, their situation is very similar to being pinned. Return 164 * XFS_ITEM_PINNED so that the caller will eventually flush the log. 165 * This should help in getting the EFI out of the AIL. 166 */ 167/*ARGSUSED*/ 168STATIC uint