diff options
author | Christoph Hellwig <hch@lst.de> | 2008-11-27 22:23:42 -0500 |
---|---|---|
committer | Niv Sardi <xaiki@sgi.com> | 2008-11-30 19:38:22 -0500 |
commit | 0e446673a15a4e9c336b67c1a638eb12c21d0993 (patch) | |
tree | 3da13a58ef93add05e33ef14fba73ed03dd58e01 /fs | |
parent | 24f211bad09a31f19dda0c3faffe0244f4f235f5 (diff) |
[XFS] fix error handling in xlog_recover_process_one_iunlink
If we fail after xfs_iget we have to drop the reference count, spotted
by Dave Chinner. Also remove some useless asserts and stop trying to
deal with di_mode == 0 inodes because never gets those without passing
the IGET_CREATE flag to xfs_iget.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index ce6e907bec62..51412cced010 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -3147,13 +3147,12 @@ xlog_recover_process_one_iunlink( | |||
3147 | /* | 3147 | /* |
3148 | * Get the on disk inode to find the next inode in the bucket. | 3148 | * Get the on disk inode to find the next inode in the bucket. |
3149 | */ | 3149 | */ |
3150 | ASSERT(ip != NULL); | ||
3151 | error = xfs_itobp(mp, NULL, ip, &dip, &ibp, XFS_BUF_LOCK); | 3150 | error = xfs_itobp(mp, NULL, ip, &dip, &ibp, XFS_BUF_LOCK); |
3152 | if (error) | 3151 | if (error) |
3153 | goto fail; | 3152 | goto fail_iput; |
3154 | 3153 | ||
3155 | ASSERT(dip != NULL); | ||
3156 | ASSERT(ip->i_d.di_nlink == 0); | 3154 | ASSERT(ip->i_d.di_nlink == 0); |
3155 | ASSERT(ip->i_d.di_mode != 0); | ||
3157 | 3156 | ||
3158 | /* setup for the next pass */ | 3157 | /* setup for the next pass */ |
3159 | agino = be32_to_cpu(dip->di_next_unlinked); | 3158 | agino = be32_to_cpu(dip->di_next_unlinked); |
@@ -3165,18 +3164,11 @@ xlog_recover_process_one_iunlink( | |||
3165 | */ | 3164 | */ |
3166 | ip->i_d.di_dmevmask = 0; | 3165 | ip->i_d.di_dmevmask = 0; |
3167 | 3166 | ||
3168 | /* | 3167 | IRELE(ip); |
3169 | * If this is a new inode, handle it specially. Otherwise, just | ||
3170 | * drop our reference to the inode. If there are no other | ||
3171 | * references, this will send the inode to xfs_inactive() which | ||
3172 | * will truncate the file and free the inode. | ||
3173 | */ | ||
3174 | if (ip->i_d.di_mode == 0) | ||
3175 | xfs_iput_new(ip, 0); | ||
3176 | else | ||
3177 | IRELE(ip); | ||
3178 | return agino; | 3168 | return agino; |
3179 | 3169 | ||
3170 | fail_iput: | ||
3171 | IRELE(ip); | ||
3180 | fail: | 3172 | fail: |
3181 | /* | 3173 | /* |
3182 | * We can't read in the inode this bucket points to, or this inode | 3174 | * We can't read in the inode this bucket points to, or this inode |