diff options
author | Dave Chinner <david@fromorbit.com> | 2016-03-06 17:30:32 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-03-06 17:30:32 -0500 |
commit | a2bbcb60ff9a8e8a4159e11bc3ed84f7221fe79f (patch) | |
tree | 892f8d40b2267422d2d38a62acace8ed613f71a8 /fs/xfs/xfs_log_recover.c | |
parent | 6d247d47fbd6883f7096e0e672afbdba6286dbc4 (diff) | |
parent | c19b3b05ae440de50fffe2ac2a9b27392a7448e9 (diff) |
Merge branch 'xfs-gut-icdinode-4.6' into for-next
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 2c449a25c4f6..e776594889c3 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -2865,7 +2865,7 @@ xfs_recover_inode_owner_change( | |||
2865 | return -ENOMEM; | 2865 | return -ENOMEM; |
2866 | 2866 | ||
2867 | /* instantiate the inode */ | 2867 | /* instantiate the inode */ |
2868 | xfs_dinode_from_disk(&ip->i_d, dip); | 2868 | xfs_inode_from_disk(ip, dip); |
2869 | ASSERT(ip->i_d.di_version >= 3); | 2869 | ASSERT(ip->i_d.di_version >= 3); |
2870 | 2870 | ||
2871 | error = xfs_iformat_fork(ip, dip); | 2871 | error = xfs_iformat_fork(ip, dip); |
@@ -2911,7 +2911,7 @@ xlog_recover_inode_pass2( | |||
2911 | int error; | 2911 | int error; |
2912 | int attr_index; | 2912 | int attr_index; |
2913 | uint fields; | 2913 | uint fields; |
2914 | xfs_icdinode_t *dicp; | 2914 | struct xfs_log_dinode *ldip; |
2915 | uint isize; | 2915 | uint isize; |
2916 | int need_free = 0; | 2916 | int need_free = 0; |
2917 | 2917 | ||
@@ -2964,8 +2964,8 @@ xlog_recover_inode_pass2( | |||
2964 | error = -EFSCORRUPTED; | 2964 | error = -EFSCORRUPTED; |
2965 | goto out_release; | 2965 | goto out_release; |
2966 | } | 2966 | } |
2967 | dicp = item->ri_buf[1].i_addr; | 2967 | ldip = item->ri_buf[1].i_addr; |
2968 | if (unlikely(dicp->di_magic != XFS_DINODE_MAGIC)) { | 2968 | if (unlikely(ldip->di_magic != XFS_DINODE_MAGIC)) { |
2969 | xfs_alert(mp, | 2969 | xfs_alert(mp, |
2970 | "%s: Bad inode log record, rec ptr 0x%p, ino %Ld", | 2970 | "%s: Bad inode log record, rec ptr 0x%p, ino %Ld", |
2971 | __func__, item, in_f->ilf_ino); | 2971 | __func__, item, in_f->ilf_ino); |
@@ -3001,13 +3001,13 @@ xlog_recover_inode_pass2( | |||
3001 | * to skip replay when the on disk inode is newer than the log one | 3001 | * to skip replay when the on disk inode is newer than the log one |
3002 | */ | 3002 | */ |
3003 | if (!xfs_sb_version_hascrc(&mp->m_sb) && | 3003 | if (!xfs_sb_version_hascrc(&mp->m_sb) && |
3004 | dicp->di_flushiter < be16_to_cpu(dip->di_flushiter)) { | 3004 | ldip->di_flushiter < be16_to_cpu(dip->di_flushiter)) { |
3005 | /* | 3005 | /* |
3006 | * Deal with the wrap case, DI_MAX_FLUSH is less | 3006 | * Deal with the wrap case, DI_MAX_FLUSH is less |
3007 | * than smaller numbers | 3007 | * than smaller numbers |
3008 | */ | 3008 | */ |
3009 | if (be16_to_cpu(dip->di_flushiter) == DI_MAX_FLUSH && | 3009 | if (be16_to_cpu(dip->di_flushiter) == DI_MAX_FLUSH && |
3010 | dicp->di_flushiter < (DI_MAX_FLUSH >> 1)) { | 3010 | ldip->di_flushiter < (DI_MAX_FLUSH >> 1)) { |
3011 | /* do nothing */ | 3011 | /* do nothing */ |
3012 | } else { | 3012 | } else { |
3013 | trace_xfs_log_recover_inode_skip(log, in_f); | 3013 | trace_xfs_log_recover_inode_skip(log, in_f); |
@@ -3017,13 +3017,13 @@ xlog_recover_inode_pass2( | |||
3017 | } | 3017 | } |
3018 | 3018 | ||
3019 | /* Take the opportunity to reset the flush iteration count */ | 3019 | /* Take the opportunity to reset the flush iteration count */ |
3020 | dicp->di_flushiter = 0; | 3020 | ldip->di_flushiter = 0; |
3021 | 3021 | ||
3022 | if (unlikely(S_ISREG(dicp->di_mode))) { | 3022 | if (unlikely(S_ISREG(ldip->di_mode))) { |
3023 | if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && | 3023 | if ((ldip->di_format != XFS_DINODE_FMT_EXTENTS) && |
3024 | (dicp->di_format != XFS_DINODE_FMT_BTREE)) { | 3024 | (ldip->di_format != XFS_DINODE_FMT_BTREE)) { |
3025 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(3)", | 3025 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(3)", |
3026 | XFS_ERRLEVEL_LOW, mp, dicp); | 3026 | XFS_ERRLEVEL_LOW, mp, ldip); |
3027 | xfs_alert(mp, | 3027 | xfs_alert(mp, |
3028 | "%s: Bad regular inode log record, rec ptr 0x%p, " | 3028 | "%s: Bad regular inode log record, rec ptr 0x%p, " |
3029 | "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", | 3029 | "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", |
@@ -3031,12 +3031,12 @@ xlog_recover_inode_pass2( | |||
3031 | error = -EFSCORRUPTED; | 3031 | error = -EFSCORRUPTED; |
3032 | goto out_release; | 3032 | goto out_release; |
3033 | } | 3033 | } |
3034 | } else if (unlikely(S_ISDIR(dicp->di_mode))) { | 3034 | } else if (unlikely(S_ISDIR(ldip->di_mode))) { |
3035 | if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && | 3035 | if ((ldip->di_format != XFS_DINODE_FMT_EXTENTS) && |
3036 | (dicp->di_format != XFS_DINODE_FMT_BTREE) && | 3036 | (ldip->di_format != XFS_DINODE_FMT_BTREE) && |
3037 | (dicp->di_format != XFS_DINODE_FMT_LOCAL)) { | 3037 | (ldip->di_format != XFS_DINODE_FMT_LOCAL)) { |
3038 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(4)", | 3038 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(4)", |
3039 | XFS_ERRLEVEL_LOW, mp, dicp); | 3039 | XFS_ERRLEVEL_LOW, mp, ldip); |
3040 | xfs_alert(mp, | 3040 | xfs_alert(mp, |
3041 | "%s: Bad dir inode log record, rec ptr 0x%p, " | 3041 | "%s: Bad dir inode log record, rec ptr 0x%p, " |
3042 | "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", | 3042 | "ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", |
@@ -3045,32 +3045,32 @@ xlog_recover_inode_pass2( | |||
3045 | goto out_release; | 3045 | goto out_release; |
3046 | } | 3046 | } |
3047 | } | 3047 | } |
3048 | if (unlikely(dicp->di_nextents + dicp->di_anextents > dicp->di_nblocks)){ | 3048 | if (unlikely(ldip->di_nextents + ldip->di_anextents > ldip->di_nblocks)){ |
3049 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)", | 3049 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)", |
3050 | XFS_ERRLEVEL_LOW, mp, dicp); | 3050 | XFS_ERRLEVEL_LOW, mp, ldip); |
3051 | xfs_alert(mp, | 3051 | xfs_alert(mp, |
3052 | "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " | 3052 | "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " |
3053 | "dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld", | 3053 | "dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld", |
3054 | __func__, item, dip, bp, in_f->ilf_ino, | 3054 | __func__, item, dip, bp, in_f->ilf_ino, |
3055 | dicp->di_nextents + dicp->di_anextents, | 3055 | ldip->di_nextents + ldip->di_anextents, |
3056 | dicp->di_nblocks); | 3056 | ldip->di_nblocks); |
3057 | error = -EFSCORRUPTED; | 3057 | error = -EFSCORRUPTED; |
3058 | goto out_release; | 3058 | goto out_release; |
3059 | } | 3059 | } |
3060 | if (unlikely(dicp->di_forkoff > mp->m_sb.sb_inodesize)) { | 3060 | if (unlikely(ldip->di_forkoff > mp->m_sb.sb_inodesize)) { |
3061 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)", | 3061 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)", |
3062 | XFS_ERRLEVEL_LOW, mp, dicp); | 3062 | XFS_ERRLEVEL_LOW, mp, ldip); |
3063 | xfs_alert(mp, | 3063 | xfs_alert(mp, |
3064 | "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " | 3064 | "%s: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, " |
3065 | "dino bp 0x%p, ino %Ld, forkoff 0x%x", __func__, | 3065 | "dino bp 0x%p, ino %Ld, forkoff 0x%x", __func__, |
3066 | item, dip, bp, in_f->ilf_ino, dicp->di_forkoff); | 3066 | item, dip, bp, in_f->ilf_ino, ldip->di_forkoff); |
3067 | error = -EFSCORRUPTED; | 3067 | error = -EFSCORRUPTED; |
3068 | goto out_release; | 3068 | goto out_release; |
3069 | } | 3069 | } |
3070 | isize = xfs_icdinode_size(dicp->di_version); | 3070 | isize = xfs_log_dinode_size(ldip->di_version); |
3071 | if (unlikely(item->ri_buf[1].i_len > isize)) { | 3071 | if (unlikely(item->ri_buf[1].i_len > isize)) { |
3072 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)", | 3072 | XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)", |
3073 | XFS_ERRLEVEL_LOW, mp, dicp); | 3073 | XFS_ERRLEVEL_LOW, mp, ldip); |
3074 | xfs_alert(mp, | 3074 | xfs_alert(mp, |
3075 | "%s: Bad inode log record length %d, rec ptr 0x%p", | 3075 | "%s: Bad inode log record length %d, rec ptr 0x%p", |
3076 | __func__, item->ri_buf[1].i_len, item); | 3076 | __func__, item->ri_buf[1].i_len, item); |
@@ -3078,8 +3078,8 @@ xlog_recover_inode_pass2( | |||
3078 | goto out_release; | 3078 | goto out_release; |
3079 | } | 3079 | } |
3080 | 3080 | ||
3081 | /* The core is in in-core format */ | 3081 | /* recover the log dinode inode into the on disk inode */ |
3082 | xfs_dinode_to_disk(dip, dicp); | 3082 | xfs_log_dinode_to_disk(ldip, dip); |
3083 | 3083 | ||
3084 | /* the rest is in on-disk format */ | 3084 | /* the rest is in on-disk format */ |
3085 | if (item->ri_buf[1].i_len > isize) { | 3085 | if (item->ri_buf[1].i_len > isize) { |
@@ -4409,8 +4409,8 @@ xlog_recover_process_one_iunlink( | |||
4409 | if (error) | 4409 | if (error) |
4410 | goto fail_iput; | 4410 | goto fail_iput; |
4411 | 4411 | ||
4412 | ASSERT(ip->i_d.di_nlink == 0); | 4412 | ASSERT(VFS_I(ip)->i_nlink == 0); |
4413 | ASSERT(ip->i_d.di_mode != 0); | 4413 | ASSERT(VFS_I(ip)->i_mode != 0); |
4414 | 4414 | ||
4415 | /* setup for the next pass */ | 4415 | /* setup for the next pass */ |
4416 | agino = be32_to_cpu(dip->di_next_unlinked); | 4416 | agino = be32_to_cpu(dip->di_next_unlinked); |