diff options
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 7c75c7374d5a..8ecad5bad66c 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -3161,37 +3161,26 @@ xlog_recover_process_iunlinks( | |||
3161 | */ | 3161 | */ |
3162 | continue; | 3162 | continue; |
3163 | } | 3163 | } |
3164 | /* | ||
3165 | * Unlock the buffer so that it can be acquired in the normal | ||
3166 | * course of the transaction to truncate and free each inode. | ||
3167 | * Because we are not racing with anyone else here for the AGI | ||
3168 | * buffer, we don't even need to hold it locked to read the | ||
3169 | * initial unlinked bucket entries out of the buffer. We keep | ||
3170 | * buffer reference though, so that it stays pinned in memory | ||
3171 | * while we need the buffer. | ||
3172 | */ | ||
3164 | agi = XFS_BUF_TO_AGI(agibp); | 3173 | agi = XFS_BUF_TO_AGI(agibp); |
3174 | xfs_buf_unlock(agibp); | ||
3165 | 3175 | ||
3166 | for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++) { | 3176 | for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++) { |
3167 | agino = be32_to_cpu(agi->agi_unlinked[bucket]); | 3177 | agino = be32_to_cpu(agi->agi_unlinked[bucket]); |
3168 | while (agino != NULLAGINO) { | 3178 | while (agino != NULLAGINO) { |
3169 | /* | ||
3170 | * Release the agi buffer so that it can | ||
3171 | * be acquired in the normal course of the | ||
3172 | * transaction to truncate and free the inode. | ||
3173 | */ | ||
3174 | xfs_buf_relse(agibp); | ||
3175 | |||
3176 | agino = xlog_recover_process_one_iunlink(mp, | 3179 | agino = xlog_recover_process_one_iunlink(mp, |
3177 | agno, agino, bucket); | 3180 | agno, agino, bucket); |
3178 | |||
3179 | /* | ||
3180 | * Reacquire the agibuffer and continue around | ||
3181 | * the loop. This should never fail as we know | ||
3182 | * the buffer was good earlier on. | ||
3183 | */ | ||
3184 | error = xfs_read_agi(mp, NULL, agno, &agibp); | ||
3185 | ASSERT(error == 0); | ||
3186 | agi = XFS_BUF_TO_AGI(agibp); | ||
3187 | } | 3181 | } |
3188 | } | 3182 | } |
3189 | 3183 | xfs_buf_rele(agibp); | |
3190 | /* | ||
3191 | * Release the buffer for the current agi so we can | ||
3192 | * go on to the next one. | ||
3193 | */ | ||
3194 | xfs_buf_relse(agibp); | ||
3195 | } | 3184 | } |
3196 | 3185 | ||
3197 | mp->m_dmevmask = mp_dmevmask; | 3186 | mp->m_dmevmask = mp_dmevmask; |