aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 8ae6e8e5f3db..851eca8a7150 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2245,7 +2245,7 @@ xlog_recover_do_inode_trans(
2245 int error; 2245 int error;
2246 int attr_index; 2246 int attr_index;
2247 uint fields; 2247 uint fields;
2248 xfs_dinode_core_t *dicp; 2248 xfs_icdinode_t *dicp;
2249 int need_free = 0; 2249 int need_free = 0;
2250 2250
2251 if (pass == XLOG_RECOVER_PASS1) { 2251 if (pass == XLOG_RECOVER_PASS1) {
@@ -2309,7 +2309,7 @@ xlog_recover_do_inode_trans(
2309 * Make sure the place we're flushing out to really looks 2309 * Make sure the place we're flushing out to really looks
2310 * like an inode! 2310 * like an inode!
2311 */ 2311 */
2312 if (unlikely(INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC)) { 2312 if (unlikely(be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC)) {
2313 xfs_buf_relse(bp); 2313 xfs_buf_relse(bp);
2314 xfs_fs_cmn_err(CE_ALERT, mp, 2314 xfs_fs_cmn_err(CE_ALERT, mp,
2315 "xfs_inode_recover: Bad inode magic number, dino ptr = 0x%p, dino bp = 0x%p, ino = %Ld", 2315 "xfs_inode_recover: Bad inode magic number, dino ptr = 0x%p, dino bp = 0x%p, ino = %Ld",
@@ -2319,7 +2319,7 @@ xlog_recover_do_inode_trans(
2319 error = EFSCORRUPTED; 2319 error = EFSCORRUPTED;
2320 goto error; 2320 goto error;
2321 } 2321 }
2322 dicp = (xfs_dinode_core_t*)(item->ri_buf[1].i_addr); 2322 dicp = (xfs_icdinode_t *)(item->ri_buf[1].i_addr);
2323 if (unlikely(dicp->di_magic != XFS_DINODE_MAGIC)) { 2323 if (unlikely(dicp->di_magic != XFS_DINODE_MAGIC)) {
2324 xfs_buf_relse(bp); 2324 xfs_buf_relse(bp);
2325 xfs_fs_cmn_err(CE_ALERT, mp, 2325 xfs_fs_cmn_err(CE_ALERT, mp,
@@ -2332,15 +2332,13 @@ xlog_recover_do_inode_trans(
2332 } 2332 }
2333 2333
2334 /* Skip replay when the on disk inode is newer than the log one */ 2334 /* Skip replay when the on disk inode is newer than the log one */
2335 if (dicp->di_flushiter < 2335 if (dicp->di_flushiter < be16_to_cpu(dip->di_core.di_flushiter)) {
2336 INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT)) {
2337 /* 2336 /*
2338 * Deal with the wrap case, DI_MAX_FLUSH is less 2337 * Deal with the wrap case, DI_MAX_FLUSH is less
2339 * than smaller numbers 2338 * than smaller numbers
2340 */ 2339 */
2341 if ((INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT) 2340 if (be16_to_cpu(dip->di_core.di_flushiter) == DI_MAX_FLUSH &&
2342 == DI_MAX_FLUSH) && 2341 dicp->di_flushiter < (DI_MAX_FLUSH >> 1)) {
2343 (dicp->di_flushiter < (DI_MAX_FLUSH>>1))) {
2344 /* do nothing */ 2342 /* do nothing */
2345 } else { 2343 } else {
2346 xfs_buf_relse(bp); 2344 xfs_buf_relse(bp);
@@ -2411,8 +2409,8 @@ xlog_recover_do_inode_trans(
2411 } 2409 }
2412 2410
2413 /* The core is in in-core format */ 2411 /* The core is in in-core format */
2414 xfs_xlate_dinode_core((xfs_caddr_t)&dip->di_core, 2412 xfs_dinode_to_disk(&dip->di_core,
2415 (xfs_dinode_core_t*)item->ri_buf[1].i_addr, -1); 2413 (xfs_icdinode_t *)item->ri_buf[1].i_addr);
2416 2414
2417 /* the rest is in on-disk format */ 2415 /* the rest is in on-disk format */
2418 if (item->ri_buf[1].i_len > sizeof(xfs_dinode_core_t)) { 2416 if (item->ri_buf[1].i_len > sizeof(xfs_dinode_core_t)) {
@@ -2424,8 +2422,7 @@ xlog_recover_do_inode_trans(
2424 fields = in_f->ilf_fields; 2422 fields = in_f->ilf_fields;
2425 switch (fields & (XFS_ILOG_DEV | XFS_ILOG_UUID)) { 2423 switch (fields & (XFS_ILOG_DEV | XFS_ILOG_UUID)) {
2426 case XFS_ILOG_DEV: 2424 case XFS_ILOG_DEV:
2427 INT_SET(dip->di_u.di_dev, ARCH_CONVERT, in_f->ilf_u.ilfu_rdev); 2425 dip->di_u.di_dev = cpu_to_be32(in_f->ilf_u.ilfu_rdev);
2428
2429 break; 2426 break;
2430 case XFS_ILOG_UUID: 2427 case XFS_ILOG_UUID:
2431 dip->di_u.di_muuid = in_f->ilf_u.ilfu_uuid; 2428 dip->di_u.di_muuid = in_f->ilf_u.ilfu_uuid;
@@ -3234,8 +3231,8 @@ xlog_recover_process_iunlinks(
3234 ASSERT(ip->i_d.di_nlink == 0); 3231 ASSERT(ip->i_d.di_nlink == 0);
3235 3232
3236 /* setup for the next pass */ 3233 /* setup for the next pass */
3237 agino = INT_GET(dip->di_next_unlinked, 3234 agino = be32_to_cpu(
3238 ARCH_CONVERT); 3235 dip->di_next_unlinked);
3239 xfs_buf_relse(ibp); 3236 xfs_buf_relse(ibp);
3240 /* 3237 /*
3241 * Prevent any DMAPI event from 3238 * Prevent any DMAPI event from
@@ -3837,7 +3834,10 @@ xlog_do_recover(
3837 */ 3834 */
3838 bp = xfs_getsb(log->l_mp, 0); 3835 bp = xfs_getsb(log->l_mp, 0);
3839 XFS_BUF_UNDONE(bp); 3836 XFS_BUF_UNDONE(bp);
3837 ASSERT(!(XFS_BUF_ISWRITE(bp)));
3838 ASSERT(!(XFS_BUF_ISDELAYWRITE(bp)));
3840 XFS_BUF_READ(bp); 3839 XFS_BUF_READ(bp);
3840 XFS_BUF_UNASYNC(bp);
3841 xfsbdstrat(log->l_mp, bp); 3841 xfsbdstrat(log->l_mp, bp);
3842 if ((error = xfs_iowait(bp))) { 3842 if ((error = xfs_iowait(bp))) {
3843 xfs_ioerror_alert("xlog_do_recover", 3843 xfs_ioerror_alert("xlog_do_recover",
@@ -3849,7 +3849,7 @@ xlog_do_recover(
3849 3849
3850 /* Convert superblock from on-disk format */ 3850 /* Convert superblock from on-disk format */
3851 sbp = &log->l_mp->m_sb; 3851 sbp = &log->l_mp->m_sb;
3852 xfs_xlatesb(XFS_BUF_TO_SBP(bp), sbp, 1, XFS_SB_ALL_BITS); 3852 xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp));
3853 ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC); 3853 ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC);
3854 ASSERT(XFS_SB_GOOD_VERSION(sbp)); 3854 ASSERT(XFS_SB_GOOD_VERSION(sbp));
3855 xfs_buf_relse(bp); 3855 xfs_buf_relse(bp);
@@ -4027,7 +4027,7 @@ xlog_recover_check_summary(
4027 sbbp = xfs_getsb(mp, 0); 4027 sbbp = xfs_getsb(mp, 0);
4028#ifdef XFS_LOUD_RECOVERY 4028#ifdef XFS_LOUD_RECOVERY
4029 sbp = &mp->m_sb; 4029 sbp = &mp->m_sb;
4030 xfs_xlatesb(XFS_BUF_TO_SBP(sbbp), sbp, 1, XFS_SB_ALL_BITS); 4030 xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(sbbp));
4031 cmn_err(CE_NOTE, 4031 cmn_err(CE_NOTE,
4032 "xlog_recover_check_summary: sb_icount %Lu itotal %Lu", 4032 "xlog_recover_check_summary: sb_icount %Lu itotal %Lu",
4033 sbp->sb_icount, itotal); 4033 sbp->sb_icount, itotal);