diff options
author | Dave Chinner <david@fromorbit.com> | 2016-03-09 08:18:30 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-03-09 08:18:30 +1100 |
commit | ab9d1e4f7b0217948a3b35a64178602ab30ff45d (patch) | |
tree | 49845bb88fdd82fa5baee40b411eec1b8e5b17d9 /fs/xfs/xfs_log_recover.c | |
parent | 3c1a79f5fff9b5ef653dc8b900ce818860c1f710 (diff) | |
parent | a5fd276bdc4fb71b06d100a6abc77ad682f77de4 (diff) | |
download | linux-stable-ab9d1e4f7b0217948a3b35a64178602ab30ff45d.tar.gz linux-stable-ab9d1e4f7b0217948a3b35a64178602ab30ff45d.tar.bz2 linux-stable-ab9d1e4f7b0217948a3b35a64178602ab30ff45d.zip |
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( xfs_daddr_t head_blk, xfs_daddr_t tail_blk) { + struct xfs_mount *mp = log->l_mp; int error; xfs_buf_t *bp; xfs_sb_t *sbp; @@ -4977,7 +4978,7 @@ xlog_do_recover( /* * If IO errors happened during recovery, bail out. */ - if (XFS_FORCED_SHUTDOWN(log->l_mp)) { + if (XFS_FORCED_SHUTDOWN(mp)) { return -EIO; } @@ -4990,13 +4991,13 @@ xlog_do_recover( * or iunlinks they will have some entries in the AIL; so we look at * the AIL to determine how to set the tail_lsn. */ - xlog_assign_tail_lsn(log->l_mp); + xlog_assign_tail_lsn(mp); /* * Now that we've finished replaying all buffer and inode * updates, re-read in the superblock and reverify it. */ - bp = xfs_getsb(log->l_mp, 0); + bp = xfs_getsb(mp, 0); bp->b_flags &= ~(XBF_DONE | XBF_ASYNC); ASSERT(!(bp->b_flags & XBF_WRITE)); bp->b_flags |= XBF_READ; @@ -5004,7 +5005,7 @@ xlog_do_recover( error = xfs_buf_submit_wait(bp); if (error) { - if (!XFS_FORCED_SHUTDOWN(log->l_mp)) { + if (!XFS_FORCED_SHUTDOWN(mp)) { xfs_buf_ioerror_alert(bp, __func__); ASSERT(0); } @@ -5013,14 +5014,17 @@ xlog_do_recover( } /* Convert superblock from on-disk format */ - sbp = &log->l_mp->m_sb; + sbp = &mp->m_sb; xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp)); - ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC); - ASSERT(xfs_sb_good_version(sbp)); - xfs_reinit_percpu_counters(log->l_mp); - xfs_buf_relse(bp); + /* re-initialise in-core superblock and geometry structures */ + xfs_reinit_percpu_counters(mp); + error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); + if (error) { + xfs_warn(mp, "Failed post-recovery per-ag init: %d", error); + return error; + } xlog_recover_check_summary(log); |