diff options
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index fb17f8226b09..1ec98ed914d4 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -2206,6 +2206,7 @@ xlog_recover_do_buffer_trans( | |||
2206 | xfs_daddr_t blkno; | 2206 | xfs_daddr_t blkno; |
2207 | int len; | 2207 | int len; |
2208 | ushort flags; | 2208 | ushort flags; |
2209 | uint buf_flags; | ||
2209 | 2210 | ||
2210 | buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; | 2211 | buf_f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; |
2211 | 2212 | ||
@@ -2246,12 +2247,11 @@ xlog_recover_do_buffer_trans( | |||
2246 | } | 2247 | } |
2247 | 2248 | ||
2248 | mp = log->l_mp; | 2249 | mp = log->l_mp; |
2249 | if (flags & XFS_BLI_INODE_BUF) { | 2250 | buf_flags = XFS_BUF_LOCK; |
2250 | bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, | 2251 | if (!(flags & XFS_BLI_INODE_BUF)) |
2251 | XFS_BUF_LOCK); | 2252 | buf_flags |= XFS_BUF_MAPPED; |
2252 | } else { | 2253 | |
2253 | bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, 0); | 2254 | bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, buf_flags); |
2254 | } | ||
2255 | if (XFS_BUF_ISERROR(bp)) { | 2255 | if (XFS_BUF_ISERROR(bp)) { |
2256 | xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp, | 2256 | xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp, |
2257 | bp, blkno); | 2257 | bp, blkno); |
@@ -2350,8 +2350,8 @@ xlog_recover_do_inode_trans( | |||
2350 | goto error; | 2350 | goto error; |
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | bp = xfs_buf_read_flags(mp->m_ddev_targp, in_f->ilf_blkno, | 2353 | bp = xfs_buf_read(mp->m_ddev_targp, in_f->ilf_blkno, in_f->ilf_len, |
2354 | in_f->ilf_len, XFS_BUF_LOCK); | 2354 | XFS_BUF_LOCK); |
2355 | if (XFS_BUF_ISERROR(bp)) { | 2355 | if (XFS_BUF_ISERROR(bp)) { |
2356 | xfs_ioerror_alert("xlog_recover_do..(read#2)", mp, | 2356 | xfs_ioerror_alert("xlog_recover_do..(read#2)", mp, |
2357 | bp, in_f->ilf_blkno); | 2357 | bp, in_f->ilf_blkno); |
@@ -3517,7 +3517,7 @@ xlog_do_recovery_pass( | |||
3517 | { | 3517 | { |
3518 | xlog_rec_header_t *rhead; | 3518 | xlog_rec_header_t *rhead; |
3519 | xfs_daddr_t blk_no; | 3519 | xfs_daddr_t blk_no; |
3520 | xfs_caddr_t bufaddr, offset; | 3520 | xfs_caddr_t offset; |
3521 | xfs_buf_t *hbp, *dbp; | 3521 | xfs_buf_t *hbp, *dbp; |
3522 | int error = 0, h_size; | 3522 | int error = 0, h_size; |
3523 | int bblks, split_bblks; | 3523 | int bblks, split_bblks; |
@@ -3610,7 +3610,7 @@ xlog_do_recovery_pass( | |||
3610 | /* | 3610 | /* |
3611 | * Check for header wrapping around physical end-of-log | 3611 | * Check for header wrapping around physical end-of-log |
3612 | */ | 3612 | */ |
3613 | offset = NULL; | 3613 | offset = XFS_BUF_PTR(hbp); |
3614 | split_hblks = 0; | 3614 | split_hblks = 0; |
3615 | wrapped_hblks = 0; | 3615 | wrapped_hblks = 0; |
3616 | if (blk_no + hblks <= log->l_logBBsize) { | 3616 | if (blk_no + hblks <= log->l_logBBsize) { |
@@ -3646,9 +3646,8 @@ xlog_do_recovery_pass( | |||
3646 | * - order is important. | 3646 | * - order is important. |
3647 | */ | 3647 | */ |
3648 | wrapped_hblks = hblks - split_hblks; | 3648 | wrapped_hblks = hblks - split_hblks; |
3649 | bufaddr = XFS_BUF_PTR(hbp); | ||
3650 | error = XFS_BUF_SET_PTR(hbp, | 3649 | error = XFS_BUF_SET_PTR(hbp, |
3651 | bufaddr + BBTOB(split_hblks), | 3650 | offset + BBTOB(split_hblks), |
3652 | BBTOB(hblks - split_hblks)); | 3651 | BBTOB(hblks - split_hblks)); |
3653 | if (error) | 3652 | if (error) |
3654 | goto bread_err2; | 3653 | goto bread_err2; |
@@ -3658,14 +3657,10 @@ xlog_do_recovery_pass( | |||
3658 | if (error) | 3657 | if (error) |
3659 | goto bread_err2; | 3658 | goto bread_err2; |
3660 | 3659 | ||
3661 | error = XFS_BUF_SET_PTR(hbp, bufaddr, | 3660 | error = XFS_BUF_SET_PTR(hbp, offset, |
3662 | BBTOB(hblks)); | 3661 | BBTOB(hblks)); |
3663 | if (error) | 3662 | if (error) |
3664 | goto bread_err2; | 3663 | goto bread_err2; |
3665 | |||
3666 | if (!offset) | ||
3667 | offset = xlog_align(log, 0, | ||
3668 | wrapped_hblks, hbp); | ||
3669 | } | 3664 | } |
3670 | rhead = (xlog_rec_header_t *)offset; | 3665 | rhead = (xlog_rec_header_t *)offset; |
3671 | error = xlog_valid_rec_header(log, rhead, | 3666 | error = xlog_valid_rec_header(log, rhead, |
@@ -3685,7 +3680,7 @@ xlog_do_recovery_pass( | |||
3685 | } else { | 3680 | } else { |
3686 | /* This log record is split across the | 3681 | /* This log record is split across the |
3687 | * physical end of log */ | 3682 | * physical end of log */ |
3688 | offset = NULL; | 3683 | offset = XFS_BUF_PTR(dbp); |
3689 | split_bblks = 0; | 3684 | split_bblks = 0; |
3690 | if (blk_no != log->l_logBBsize) { | 3685 | if (blk_no != log->l_logBBsize) { |
3691 | /* some data is before the physical | 3686 | /* some data is before the physical |
@@ -3714,9 +3709,8 @@ xlog_do_recovery_pass( | |||
3714 | * _first_, then the log start (LR header end) | 3709 | * _first_, then the log start (LR header end) |
3715 | * - order is important. | 3710 | * - order is important. |
3716 | */ | 3711 | */ |
3717 | bufaddr = XFS_BUF_PTR(dbp); | ||
3718 | error = XFS_BUF_SET_PTR(dbp, | 3712 | error = XFS_BUF_SET_PTR(dbp, |
3719 | bufaddr + BBTOB(split_bblks), | 3713 | offset + BBTOB(split_bblks), |
3720 | BBTOB(bblks - split_bblks)); | 3714 | BBTOB(bblks - split_bblks)); |
3721 | if (error) | 3715 | if (error) |
3722 | goto bread_err2; | 3716 | goto bread_err2; |
@@ -3727,13 +3721,9 @@ xlog_do_recovery_pass( | |||
3727 | if (error) | 3721 | if (error) |
3728 | goto bread_err2; | 3722 | goto bread_err2; |
3729 | 3723 | ||
3730 | error = XFS_BUF_SET_PTR(dbp, bufaddr, h_size); | 3724 | error = XFS_BUF_SET_PTR(dbp, offset, h_size); |
3731 | if (error) | 3725 | if (error) |
3732 | goto bread_err2; | 3726 | goto bread_err2; |
3733 | |||
3734 | if (!offset) | ||
3735 | offset = xlog_align(log, wrapped_hblks, | ||
3736 | bblks - split_bblks, dbp); | ||
3737 | } | 3727 | } |
3738 | xlog_unpack_data(rhead, offset, log); | 3728 | xlog_unpack_data(rhead, offset, log); |
3739 | if ((error = xlog_recover_process_data(log, rhash, | 3729 | if ((error = xlog_recover_process_data(log, rhash, |