aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_log_recover.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index b6b669df40f3..07ab52ca8aba 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1651,6 +1651,7 @@ xlog_recover_reorder_trans(
1651 int pass) 1651 int pass)
1652{ 1652{
1653 xlog_recover_item_t *item, *n; 1653 xlog_recover_item_t *item, *n;
1654 int error = 0;
1654 LIST_HEAD(sort_list); 1655 LIST_HEAD(sort_list);
1655 LIST_HEAD(cancel_list); 1656 LIST_HEAD(cancel_list);
1656 LIST_HEAD(buffer_list); 1657 LIST_HEAD(buffer_list);
@@ -1692,9 +1693,17 @@ xlog_recover_reorder_trans(
1692 "%s: unrecognized type of log operation", 1693 "%s: unrecognized type of log operation",
1693 __func__); 1694 __func__);
1694 ASSERT(0); 1695 ASSERT(0);
1695 return XFS_ERROR(EIO); 1696 /*
1697 * return the remaining items back to the transaction
1698 * item list so they can be freed in caller.
1699 */
1700 if (!list_empty(&sort_list))
1701 list_splice_init(&sort_list, &trans->r_itemq);
1702 error = XFS_ERROR(EIO);
1703 goto out;
1696 } 1704 }
1697 } 1705 }
1706out:
1698 ASSERT(list_empty(&sort_list)); 1707 ASSERT(list_empty(&sort_list));
1699 if (!list_empty(&buffer_list)) 1708 if (!list_empty(&buffer_list))
1700 list_splice(&buffer_list, &trans->r_itemq); 1709 list_splice(&buffer_list, &trans->r_itemq);
@@ -1704,7 +1713,7 @@ xlog_recover_reorder_trans(
1704 list_splice_tail(&inode_buffer_list, &trans->r_itemq); 1713 list_splice_tail(&inode_buffer_list, &trans->r_itemq);
1705 if (!list_empty(&cancel_list)) 1714 if (!list_empty(&cancel_list))
1706 list_splice_tail(&cancel_list, &trans->r_itemq); 1715 list_splice_tail(&cancel_list, &trans->r_itemq);
1707 return 0; 1716 return error;
1708} 1717}
1709 1718
1710/* 1719/*
@@ -3608,8 +3617,10 @@ xlog_recover_process_data(
3608 error = XFS_ERROR(EIO); 3617 error = XFS_ERROR(EIO);
3609 break; 3618 break;
3610 } 3619 }
3611 if (error) 3620 if (error) {
3621 xlog_recover_free_trans(trans);
3612 return error; 3622 return error;
3623 }
3613 } 3624 }
3614 dp += be32_to_cpu(ohead->oh_len); 3625 dp += be32_to_cpu(ohead->oh_len);
3615 num_logops--; 3626 num_logops--;