diff options
author | Dave Chinner <david@fromorbit.com> | 2016-03-08 16:18:30 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-03-08 16:18:30 -0500 |
commit | ab9d1e4f7b0217948a3b35a64178602ab30ff45d (patch) | |
tree | 49845bb88fdd82fa5baee40b411eec1b8e5b17d9 /fs/xfs/xfs_log_recover.c | |
parent | 3c1a79f5fff9b5ef653dc8b900ce818860c1f710 (diff) | |
parent | a5fd276bdc4fb71b06d100a6abc77ad682f77de4 (diff) |
Merge branch 'xfs-misc-fixes-4.6-3' into for-next
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 9347bf1bdc00..396565f43247 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -4963,6 +4963,7 @@ xlog_do_recover( | |||
4963 | xfs_daddr_t head_blk, | 4963 | xfs_daddr_t head_blk, |
4964 | xfs_daddr_t tail_blk) | 4964 | xfs_daddr_t tail_blk) |
4965 | { | 4965 | { |
4966 | struct xfs_mount *mp = log->l_mp; | ||
4966 | int error; | 4967 | int error; |
4967 | xfs_buf_t *bp; | 4968 | xfs_buf_t *bp; |
4968 | xfs_sb_t *sbp; | 4969 | xfs_sb_t *sbp; |
@@ -4977,7 +4978,7 @@ xlog_do_recover( | |||
4977 | /* | 4978 | /* |
4978 | * If IO errors happened during recovery, bail out. | 4979 | * If IO errors happened during recovery, bail out. |
4979 | */ | 4980 | */ |
4980 | if (XFS_FORCED_SHUTDOWN(log->l_mp)) { | 4981 | if (XFS_FORCED_SHUTDOWN(mp)) { |
4981 | return -EIO; | 4982 | return -EIO; |
4982 | } | 4983 | } |
4983 | 4984 | ||
@@ -4990,13 +4991,13 @@ xlog_do_recover( | |||
4990 | * or iunlinks they will have some entries in the AIL; so we look at | 4991 | * or iunlinks they will have some entries in the AIL; so we look at |
4991 | * the AIL to determine how to set the tail_lsn. | 4992 | * the AIL to determine how to set the tail_lsn. |
4992 | */ | 4993 | */ |
4993 | xlog_assign_tail_lsn(log->l_mp); | 4994 | xlog_assign_tail_lsn(mp); |
4994 | 4995 | ||
4995 | /* | 4996 | /* |
4996 | * Now that we've finished replaying all buffer and inode | 4997 | * Now that we've finished replaying all buffer and inode |
4997 | * updates, re-read in the superblock and reverify it. | 4998 | * updates, re-read in the superblock and reverify it. |
4998 | */ | 4999 | */ |
4999 | bp = xfs_getsb(log->l_mp, 0); | 5000 | bp = xfs_getsb(mp, 0); |
5000 | bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); | 5001 | bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); |
5001 | ASSERT(!(bp->b_flags & XBF_WRITE)); | 5002 | ASSERT(!(bp->b_flags & XBF_WRITE)); |
5002 | bp->b_flags |= XBF_READ; | 5003 | bp->b_flags |= XBF_READ; |
@@ -5004,7 +5005,7 @@ xlog_do_recover( | |||
5004 | 5005 | ||
5005 | error = xfs_buf_submit_wait(bp); | 5006 | error = xfs_buf_submit_wait(bp); |
5006 | if (error) { | 5007 | if (error) { |
5007 | if (!XFS_FORCED_SHUTDOWN(log->l_mp)) { | 5008 | if (!XFS_FORCED_SHUTDOWN(mp)) { |
5008 | xfs_buf_ioerror_alert(bp, __func__); | 5009 | xfs_buf_ioerror_alert(bp, __func__); |
5009 | ASSERT(0); | 5010 | ASSERT(0); |
5010 | } | 5011 | } |
@@ -5013,14 +5014,17 @@ xlog_do_recover( | |||
5013 | } | 5014 | } |
5014 | 5015 | ||
5015 | /* Convert superblock from on-disk format */ | 5016 | /* Convert superblock from on-disk format */ |
5016 | sbp = &log->l_mp->m_sb; | 5017 | sbp = &mp->m_sb; |
5017 | xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp)); | 5018 | xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp)); |
5018 | ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC); | ||
5019 | ASSERT(xfs_sb_good_version(sbp)); | ||
5020 | xfs_reinit_percpu_counters(log->l_mp); | ||
5021 | |||
5022 | xfs_buf_relse(bp); | 5019 | xfs_buf_relse(bp); |
5023 | 5020 | ||
5021 | /* re-initialise in-core superblock and geometry structures */ | ||
5022 | xfs_reinit_percpu_counters(mp); | ||
5023 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); | ||
5024 | if (error) { | ||
5025 | xfs_warn(mp, "Failed post-recovery per-ag init: %d", error); | ||
5026 | return error; | ||
5027 | } | ||
5024 | 5028 | ||
5025 | xlog_recover_check_summary(log); | 5029 | xlog_recover_check_summary(log); |
5026 | 5030 | ||