提交 c9f71f5f 编写于 作者: C Christoph Hellwig 提交者: Alex Elder

xfs: untangle phase1 vs phase2 recovery helpers

Dispatch to a different helper for phase1 vs phase2 in
xlog_recover_commit_trans instead of doing it in all the
low-level functions.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 d0450948
...@@ -1616,11 +1616,12 @@ xlog_recover_reorder_trans( ...@@ -1616,11 +1616,12 @@ xlog_recover_reorder_trans(
* record in the table to tell us how many times we expect to see this * record in the table to tell us how many times we expect to see this
* record during the second pass. * record during the second pass.
*/ */
STATIC void STATIC int
xlog_recover_do_buffer_pass1( xlog_recover_buffer_pass1(
struct log *log, struct log *log,
xfs_buf_log_format_t *buf_f) xlog_recover_item_t *item)
{ {
xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr;
struct list_head *bucket; struct list_head *bucket;
struct xfs_buf_cancel *bcp; struct xfs_buf_cancel *bcp;
...@@ -1629,7 +1630,7 @@ xlog_recover_do_buffer_pass1( ...@@ -1629,7 +1630,7 @@ xlog_recover_do_buffer_pass1(
*/ */
if (!(buf_f->blf_flags & XFS_BLF_CANCEL)) { if (!(buf_f->blf_flags & XFS_BLF_CANCEL)) {
trace_xfs_log_recover_buf_not_cancel(log, buf_f); trace_xfs_log_recover_buf_not_cancel(log, buf_f);
return; return 0;
} }
/* /*
...@@ -1642,7 +1643,7 @@ xlog_recover_do_buffer_pass1( ...@@ -1642,7 +1643,7 @@ xlog_recover_do_buffer_pass1(
bcp->bc_len == buf_f->blf_len) { bcp->bc_len == buf_f->blf_len) {
bcp->bc_refcount++; bcp->bc_refcount++;
trace_xfs_log_recover_buf_cancel_ref_inc(log, buf_f); trace_xfs_log_recover_buf_cancel_ref_inc(log, buf_f);
return; return 0;
} }
} }
...@@ -1653,6 +1654,7 @@ xlog_recover_do_buffer_pass1( ...@@ -1653,6 +1654,7 @@ xlog_recover_do_buffer_pass1(
list_add_tail(&bcp->bc_list, bucket); list_add_tail(&bcp->bc_list, bucket);
trace_xfs_log_recover_buf_cancel_add(log, buf_f); trace_xfs_log_recover_buf_cancel_add(log, buf_f);
return 0;
} }
/* /*
...@@ -2081,10 +2083,9 @@ xlog_recover_do_dquot_buffer( ...@@ -2081,10 +2083,9 @@ xlog_recover_do_dquot_buffer(
* for more details on the implementation of the table of cancel records. * for more details on the implementation of the table of cancel records.
*/ */
STATIC int STATIC int
xlog_recover_do_buffer_trans( xlog_recover_buffer_pass2(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr; xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr;
xfs_mount_t *mp = log->l_mp; xfs_mount_t *mp = log->l_mp;
...@@ -2092,27 +2093,16 @@ xlog_recover_do_buffer_trans( ...@@ -2092,27 +2093,16 @@ xlog_recover_do_buffer_trans(
int error; int error;
uint buf_flags; uint buf_flags;
if (pass == XLOG_RECOVER_PASS1) { /*
/* * In this pass we only want to recover all the buffers which have
* In this pass we're only looking for buf items * not been cancelled and are not cancellation buffers themselves.
* with the XFS_BLF_CANCEL bit set. */
*/ if (xlog_check_buffer_cancelled(log, buf_f->blf_blkno,
xlog_recover_do_buffer_pass1(log, buf_f); buf_f->blf_len, buf_f->blf_flags)) {
trace_xfs_log_recover_buf_cancel(log, buf_f);
return 0; return 0;
} else {
/*
* In this pass we want to recover all the buffers
* which have not been cancelled and are not
* cancellation buffers themselves. The routine
* we call here will tell us whether or not to
* continue with the replay of this buffer.
*/
if (xlog_check_buffer_cancelled(log, buf_f->blf_blkno,
buf_f->blf_len, buf_f->blf_flags)) {
trace_xfs_log_recover_buf_cancel(log, buf_f);
return 0;
}
} }
trace_xfs_log_recover_buf_recover(log, buf_f); trace_xfs_log_recover_buf_recover(log, buf_f);
buf_flags = XBF_LOCK; buf_flags = XBF_LOCK;
...@@ -2172,16 +2162,14 @@ xlog_recover_do_buffer_trans( ...@@ -2172,16 +2162,14 @@ xlog_recover_do_buffer_trans(
} }
STATIC int STATIC int
xlog_recover_do_inode_trans( xlog_recover_inode_pass2(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
xfs_inode_log_format_t *in_f; xfs_inode_log_format_t *in_f;
xfs_mount_t *mp; xfs_mount_t *mp = log->l_mp;
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_dinode_t *dip; xfs_dinode_t *dip;
xfs_ino_t ino;
int len; int len;
xfs_caddr_t src; xfs_caddr_t src;
xfs_caddr_t dest; xfs_caddr_t dest;
...@@ -2191,10 +2179,6 @@ xlog_recover_do_inode_trans( ...@@ -2191,10 +2179,6 @@ xlog_recover_do_inode_trans(
xfs_icdinode_t *dicp; xfs_icdinode_t *dicp;
int need_free = 0; int need_free = 0;
if (pass == XLOG_RECOVER_PASS1) {
return 0;
}
if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) { if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
in_f = item->ri_buf[0].i_addr; in_f = item->ri_buf[0].i_addr;
} else { } else {
...@@ -2204,8 +2188,6 @@ xlog_recover_do_inode_trans( ...@@ -2204,8 +2188,6 @@ xlog_recover_do_inode_trans(
if (error) if (error)
goto error; goto error;
} }
ino = in_f->ilf_ino;
mp = log->l_mp;
/* /*
* Inode buffers can be freed, look out for it, * Inode buffers can be freed, look out for it,
...@@ -2240,8 +2222,8 @@ xlog_recover_do_inode_trans( ...@@ -2240,8 +2222,8 @@ xlog_recover_do_inode_trans(
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad inode magic number, dino ptr = 0x%p, dino bp = 0x%p, ino = %Ld", "xfs_inode_recover: Bad inode magic number, dino ptr = 0x%p, dino bp = 0x%p, ino = %Ld",
dip, bp, ino); dip, bp, in_f->ilf_ino);
XFS_ERROR_REPORT("xlog_recover_do_inode_trans(1)", XFS_ERROR_REPORT("xlog_recover_inode_pass2(1)",
XFS_ERRLEVEL_LOW, mp); XFS_ERRLEVEL_LOW, mp);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
...@@ -2251,8 +2233,8 @@ xlog_recover_do_inode_trans( ...@@ -2251,8 +2233,8 @@ xlog_recover_do_inode_trans(
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad inode log record, rec ptr 0x%p, ino %Ld", "xfs_inode_recover: Bad inode log record, rec ptr 0x%p, ino %Ld",
item, ino); item, in_f->ilf_ino);
XFS_ERROR_REPORT("xlog_recover_do_inode_trans(2)", XFS_ERROR_REPORT("xlog_recover_inode_pass2(2)",
XFS_ERRLEVEL_LOW, mp); XFS_ERRLEVEL_LOW, mp);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
...@@ -2280,12 +2262,12 @@ xlog_recover_do_inode_trans( ...@@ -2280,12 +2262,12 @@ xlog_recover_do_inode_trans(
if (unlikely((dicp->di_mode & S_IFMT) == S_IFREG)) { if (unlikely((dicp->di_mode & S_IFMT) == S_IFREG)) {
if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) &&
(dicp->di_format != XFS_DINODE_FMT_BTREE)) { (dicp->di_format != XFS_DINODE_FMT_BTREE)) {
XFS_CORRUPTION_ERROR("xlog_recover_do_inode_trans(3)", XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(3)",
XFS_ERRLEVEL_LOW, mp, dicp); XFS_ERRLEVEL_LOW, mp, dicp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad regular inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", "xfs_inode_recover: Bad regular inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld",
item, dip, bp, ino); item, dip, bp, in_f->ilf_ino);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
} }
...@@ -2293,40 +2275,40 @@ xlog_recover_do_inode_trans( ...@@ -2293,40 +2275,40 @@ xlog_recover_do_inode_trans(
if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) && if ((dicp->di_format != XFS_DINODE_FMT_EXTENTS) &&
(dicp->di_format != XFS_DINODE_FMT_BTREE) && (dicp->di_format != XFS_DINODE_FMT_BTREE) &&
(dicp->di_format != XFS_DINODE_FMT_LOCAL)) { (dicp->di_format != XFS_DINODE_FMT_LOCAL)) {
XFS_CORRUPTION_ERROR("xlog_recover_do_inode_trans(4)", XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(4)",
XFS_ERRLEVEL_LOW, mp, dicp); XFS_ERRLEVEL_LOW, mp, dicp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad dir inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld", "xfs_inode_recover: Bad dir inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld",
item, dip, bp, ino); item, dip, bp, in_f->ilf_ino);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
} }
} }
if (unlikely(dicp->di_nextents + dicp->di_anextents > dicp->di_nblocks)){ if (unlikely(dicp->di_nextents + dicp->di_anextents > dicp->di_nblocks)){
XFS_CORRUPTION_ERROR("xlog_recover_do_inode_trans(5)", XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)",
XFS_ERRLEVEL_LOW, mp, dicp); XFS_ERRLEVEL_LOW, mp, dicp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld", "xfs_inode_recover: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld",
item, dip, bp, ino, item, dip, bp, in_f->ilf_ino,
dicp->di_nextents + dicp->di_anextents, dicp->di_nextents + dicp->di_anextents,
dicp->di_nblocks); dicp->di_nblocks);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
} }
if (unlikely(dicp->di_forkoff > mp->m_sb.sb_inodesize)) { if (unlikely(dicp->di_forkoff > mp->m_sb.sb_inodesize)) {
XFS_CORRUPTION_ERROR("xlog_recover_do_inode_trans(6)", XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)",
XFS_ERRLEVEL_LOW, mp, dicp); XFS_ERRLEVEL_LOW, mp, dicp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_inode_recover: Bad inode log rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, forkoff 0x%x", "xfs_inode_recover: Bad inode log rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, forkoff 0x%x",
item, dip, bp, ino, dicp->di_forkoff); item, dip, bp, in_f->ilf_ino, dicp->di_forkoff);
error = EFSCORRUPTED; error = EFSCORRUPTED;
goto error; goto error;
} }
if (unlikely(item->ri_buf[1].i_len > sizeof(struct xfs_icdinode))) { if (unlikely(item->ri_buf[1].i_len > sizeof(struct xfs_icdinode))) {
XFS_CORRUPTION_ERROR("xlog_recover_do_inode_trans(7)", XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)",
XFS_ERRLEVEL_LOW, mp, dicp); XFS_ERRLEVEL_LOW, mp, dicp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
xfs_fs_cmn_err(CE_ALERT, mp, xfs_fs_cmn_err(CE_ALERT, mp,
...@@ -2418,7 +2400,7 @@ xlog_recover_do_inode_trans( ...@@ -2418,7 +2400,7 @@ xlog_recover_do_inode_trans(
break; break;
default: default:
xlog_warn("XFS: xlog_recover_do_inode_trans: Invalid flag"); xlog_warn("XFS: xlog_recover_inode_pass2: Invalid flag");
ASSERT(0); ASSERT(0);
xfs_buf_relse(bp); xfs_buf_relse(bp);
error = EIO; error = EIO;
...@@ -2442,18 +2424,11 @@ xlog_recover_do_inode_trans( ...@@ -2442,18 +2424,11 @@ xlog_recover_do_inode_trans(
* of that type. * of that type.
*/ */
STATIC int STATIC int
xlog_recover_do_quotaoff_trans( xlog_recover_quotaoff_pass1(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
xfs_qoff_logformat_t *qoff_f; xfs_qoff_logformat_t *qoff_f = item->ri_buf[0].i_addr;
if (pass == XLOG_RECOVER_PASS2) {
return (0);
}
qoff_f = item->ri_buf[0].i_addr;
ASSERT(qoff_f); ASSERT(qoff_f);
/* /*
...@@ -2474,22 +2449,17 @@ xlog_recover_do_quotaoff_trans( ...@@ -2474,22 +2449,17 @@ xlog_recover_do_quotaoff_trans(
* Recover a dquot record * Recover a dquot record
*/ */
STATIC int STATIC int
xlog_recover_do_dquot_trans( xlog_recover_dquot_pass2(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
xfs_mount_t *mp; xfs_mount_t *mp = log->l_mp;
xfs_buf_t *bp; xfs_buf_t *bp;
struct xfs_disk_dquot *ddq, *recddq; struct xfs_disk_dquot *ddq, *recddq;
int error; int error;
xfs_dq_logformat_t *dq_f; xfs_dq_logformat_t *dq_f;
uint type; uint type;
if (pass == XLOG_RECOVER_PASS1) {
return 0;
}
mp = log->l_mp;
/* /*
* Filesystems are required to send in quota flags at mount time. * Filesystems are required to send in quota flags at mount time.
...@@ -2533,7 +2503,7 @@ xlog_recover_do_dquot_trans( ...@@ -2533,7 +2503,7 @@ xlog_recover_do_dquot_trans(
if ((error = xfs_qm_dqcheck(recddq, if ((error = xfs_qm_dqcheck(recddq,
dq_f->qlf_id, dq_f->qlf_id,
0, XFS_QMOPT_DOWARN, 0, XFS_QMOPT_DOWARN,
"xlog_recover_do_dquot_trans (log copy)"))) { "xlog_recover_dquot_pass2 (log copy)"))) {
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
} }
ASSERT(dq_f->qlf_len == 1); ASSERT(dq_f->qlf_len == 1);
...@@ -2556,7 +2526,7 @@ xlog_recover_do_dquot_trans( ...@@ -2556,7 +2526,7 @@ xlog_recover_do_dquot_trans(
* minimal initialization then. * minimal initialization then.
*/ */
if (xfs_qm_dqcheck(ddq, dq_f->qlf_id, 0, XFS_QMOPT_DOWARN, if (xfs_qm_dqcheck(ddq, dq_f->qlf_id, 0, XFS_QMOPT_DOWARN,
"xlog_recover_do_dquot_trans")) { "xlog_recover_dquot_pass2")) {
xfs_buf_relse(bp); xfs_buf_relse(bp);
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
} }
...@@ -2579,24 +2549,18 @@ xlog_recover_do_dquot_trans( ...@@ -2579,24 +2549,18 @@ xlog_recover_do_dquot_trans(
* LSN. * LSN.
*/ */
STATIC int STATIC int
xlog_recover_do_efi_trans( xlog_recover_efi_pass2(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item,
xfs_lsn_t lsn, xfs_lsn_t lsn)
int pass)
{ {
int error; int error;
xfs_mount_t *mp; xfs_mount_t *mp = log->l_mp;
xfs_efi_log_item_t *efip; xfs_efi_log_item_t *efip;
xfs_efi_log_format_t *efi_formatp; xfs_efi_log_format_t *efi_formatp;
if (pass == XLOG_RECOVER_PASS1) {
return 0;
}
efi_formatp = item->ri_buf[0].i_addr; efi_formatp = item->ri_buf[0].i_addr;
mp = log->l_mp;
efip = xfs_efi_init(mp, efi_formatp->efi_nextents); efip = xfs_efi_init(mp, efi_formatp->efi_nextents);
if ((error = xfs_efi_copy_format(&(item->ri_buf[0]), if ((error = xfs_efi_copy_format(&(item->ri_buf[0]),
&(efip->efi_format)))) { &(efip->efi_format)))) {
...@@ -2623,11 +2587,10 @@ xlog_recover_do_efi_trans( ...@@ -2623,11 +2587,10 @@ xlog_recover_do_efi_trans(
* efd format structure. If we find it, we remove the efi from the * efd format structure. If we find it, we remove the efi from the
* AIL and free it. * AIL and free it.
*/ */
STATIC void STATIC int
xlog_recover_do_efd_trans( xlog_recover_efd_pass2(
xlog_t *log, xlog_t *log,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
xfs_efd_log_format_t *efd_formatp; xfs_efd_log_format_t *efd_formatp;
xfs_efi_log_item_t *efip = NULL; xfs_efi_log_item_t *efip = NULL;
...@@ -2636,10 +2599,6 @@ xlog_recover_do_efd_trans( ...@@ -2636,10 +2599,6 @@ xlog_recover_do_efd_trans(
struct xfs_ail_cursor cur; struct xfs_ail_cursor cur;
struct xfs_ail *ailp = log->l_ailp; struct xfs_ail *ailp = log->l_ailp;
if (pass == XLOG_RECOVER_PASS1) {
return;
}
efd_formatp = item->ri_buf[0].i_addr; efd_formatp = item->ri_buf[0].i_addr;
ASSERT((item->ri_buf[0].i_len == (sizeof(xfs_efd_log_format_32_t) + ASSERT((item->ri_buf[0].i_len == (sizeof(xfs_efd_log_format_32_t) +
((efd_formatp->efd_nextents - 1) * sizeof(xfs_extent_32_t)))) || ((efd_formatp->efd_nextents - 1) * sizeof(xfs_extent_32_t)))) ||
...@@ -2671,6 +2630,8 @@ xlog_recover_do_efd_trans( ...@@ -2671,6 +2630,8 @@ xlog_recover_do_efd_trans(
} }
xfs_trans_ail_cursor_done(ailp, &cur); xfs_trans_ail_cursor_done(ailp, &cur);
spin_unlock(&ailp->xa_lock); spin_unlock(&ailp->xa_lock);
return 0;
} }
/* /*
...@@ -2699,31 +2660,59 @@ xlog_recover_free_trans( ...@@ -2699,31 +2660,59 @@ xlog_recover_free_trans(
} }
STATIC int STATIC int
xlog_recover_commit_item( xlog_recover_commit_pass1(
struct log *log, struct log *log,
struct xlog_recover *trans, struct xlog_recover *trans,
xlog_recover_item_t *item, xlog_recover_item_t *item)
int pass)
{ {
trace_xfs_log_recover_item_recover(log, trans, item, pass); trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS1);
switch (ITEM_TYPE(item)) { switch (ITEM_TYPE(item)) {
case XFS_LI_BUF: case XFS_LI_BUF:
return xlog_recover_do_buffer_trans(log, item, pass); return xlog_recover_buffer_pass1(log, item);
case XFS_LI_QUOTAOFF:
return xlog_recover_quotaoff_pass1(log, item);
case XFS_LI_INODE: case XFS_LI_INODE:
return xlog_recover_do_inode_trans(log, item, pass);
case XFS_LI_EFI: case XFS_LI_EFI:
return xlog_recover_do_efi_trans(log, item, trans->r_lsn, pass);
case XFS_LI_EFD: case XFS_LI_EFD:
xlog_recover_do_efd_trans(log, item, pass); case XFS_LI_DQUOT:
/* nothing to do in pass 1 */
return 0; return 0;
default:
xlog_warn(
"XFS: invalid item type (%d) xlog_recover_commit_pass1",
ITEM_TYPE(item));
ASSERT(0);
return XFS_ERROR(EIO);
}
}
STATIC int
xlog_recover_commit_pass2(
struct log *log,
struct xlog_recover *trans,
xlog_recover_item_t *item)
{
trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS2);
switch (ITEM_TYPE(item)) {
case XFS_LI_BUF:
return xlog_recover_buffer_pass2(log, item);
case XFS_LI_INODE:
return xlog_recover_inode_pass2(log, item);
case XFS_LI_EFI:
return xlog_recover_efi_pass2(log, item, trans->r_lsn);
case XFS_LI_EFD:
return xlog_recover_efd_pass2(log, item);
case XFS_LI_DQUOT: case XFS_LI_DQUOT:
return xlog_recover_do_dquot_trans(log, item, pass); return xlog_recover_dquot_pass2(log, item);
case XFS_LI_QUOTAOFF: case XFS_LI_QUOTAOFF:
return xlog_recover_do_quotaoff_trans(log, item, pass); /* nothing to do in pass2 */
return 0;
default: default:
xlog_warn( xlog_warn(
"XFS: invalid item type (%d) xlog_recover_do_trans", ITEM_TYPE(item)); "XFS: invalid item type (%d) xlog_recover_commit_pass2",
ITEM_TYPE(item));
ASSERT(0); ASSERT(0);
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
} }
...@@ -2751,7 +2740,10 @@ xlog_recover_commit_trans( ...@@ -2751,7 +2740,10 @@ xlog_recover_commit_trans(
return error; return error;
list_for_each_entry(item, &trans->r_itemq, ri_list) { list_for_each_entry(item, &trans->r_itemq, ri_list) {
error = xlog_recover_commit_item(log, trans, item, pass); if (pass == XLOG_RECOVER_PASS1)
error = xlog_recover_commit_pass1(log, trans, item);
else
error = xlog_recover_commit_pass2(log, trans, item);
if (error) if (error)
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册