diff options
author | David Chinner <dgc@sgi.com> | 2008-04-09 22:21:18 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:58:17 -0400 |
commit | e5720eec0548c08943d759e39db0388d8fe59287 (patch) | |
tree | e38b474f0dbac30aee7141878953223a2a588c69 /fs/xfs/xfs_log_recover.c | |
parent | 3c1e2bbe5bcdcd435510a05eb121fa74b848e24f (diff) |
[XFS] Propagate errors from xfs_trans_commit().
xfs_trans_commit() can return errors when there are problems in the
transaction subsystem. They are indicative that the entire transaction may
be incomplete, and hence the error should be propagated as there is a good
possibility that there is something fatally wrong in the filesystem. Catch
and propagate or warn about commit errors in the places where they are
currently ignored.
SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30795a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 957b8caddf1e..418582b709eb 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -3017,7 +3017,7 @@ xlog_recover_process_efi( | |||
3017 | } | 3017 | } |
3018 | 3018 | ||
3019 | efip->efi_flags |= XFS_EFI_RECOVERED; | 3019 | efip->efi_flags |= XFS_EFI_RECOVERED; |
3020 | xfs_trans_commit(tp, 0); | 3020 | error = xfs_trans_commit(tp, 0); |
3021 | return error; | 3021 | return error; |
3022 | } | 3022 | } |
3023 | 3023 | ||
@@ -3131,16 +3131,13 @@ xlog_recover_clear_agi_bucket( | |||
3131 | error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, | 3131 | error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, |
3132 | XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), | 3132 | XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), |
3133 | XFS_FSS_TO_BB(mp, 1), 0, &agibp); | 3133 | XFS_FSS_TO_BB(mp, 1), 0, &agibp); |
3134 | if (error) { | 3134 | if (error) |
3135 | xfs_trans_cancel(tp, XFS_TRANS_ABORT); | 3135 | goto out_abort; |
3136 | return; | ||
3137 | } | ||
3138 | 3136 | ||
3137 | error = EINVAL; | ||
3139 | agi = XFS_BUF_TO_AGI(agibp); | 3138 | agi = XFS_BUF_TO_AGI(agibp); |
3140 | if (be32_to_cpu(agi->agi_magicnum) != XFS_AGI_MAGIC) { | 3139 | if (be32_to_cpu(agi->agi_magicnum) != XFS_AGI_MAGIC) |
3141 | xfs_trans_cancel(tp, XFS_TRANS_ABORT); | 3140 | goto out_abort; |
3142 | return; | ||
3143 | } | ||
3144 | 3141 | ||
3145 | agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO); | 3142 | agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO); |
3146 | offset = offsetof(xfs_agi_t, agi_unlinked) + | 3143 | offset = offsetof(xfs_agi_t, agi_unlinked) + |
@@ -3148,7 +3145,17 @@ xlog_recover_clear_agi_bucket( | |||
3148 | xfs_trans_log_buf(tp, agibp, offset, | 3145 | xfs_trans_log_buf(tp, agibp, offset, |
3149 | (offset + sizeof(xfs_agino_t) - 1)); | 3146 | (offset + sizeof(xfs_agino_t) - 1)); |
3150 | 3147 | ||
3151 | (void) xfs_trans_commit(tp, 0); | 3148 | error = xfs_trans_commit(tp, 0); |
3149 | if (error) | ||
3150 | goto out_error; | ||
3151 | return; | ||
3152 | |||
3153 | out_abort: | ||
3154 | xfs_trans_cancel(tp, XFS_TRANS_ABORT); | ||
3155 | out_error: | ||
3156 | xfs_fs_cmn_err(CE_WARN, mp, "xlog_recover_clear_agi_bucket: " | ||
3157 | "failed to clear agi %d. Continuing.", agno); | ||
3158 | return; | ||
3152 | } | 3159 | } |
3153 | 3160 | ||
3154 | /* | 3161 | /* |