diff options
-rw-r--r-- | fs/xfs/libxfs/xfs_refcount.c | 11 | ||||
-rw-r--r-- | fs/xfs/scrub/repair.c | 7 |
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c index a2dfae67ade1..9ef1f440a6f2 100644 --- a/fs/xfs/libxfs/xfs_refcount.c +++ b/fs/xfs/libxfs/xfs_refcount.c | |||
@@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers( | |||
1675 | high.rc.rc_startblock = -1U; | 1675 | high.rc.rc_startblock = -1U; |
1676 | error = xfs_btree_query_range(cur, &low, &high, | 1676 | error = xfs_btree_query_range(cur, &low, &high, |
1677 | xfs_refcount_recover_extent, &debris); | 1677 | xfs_refcount_recover_extent, &debris); |
1678 | if (error) | 1678 | xfs_btree_del_cursor(cur, error); |
1679 | goto out_cursor; | ||
1680 | xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); | ||
1681 | xfs_trans_brelse(tp, agbp); | 1679 | xfs_trans_brelse(tp, agbp); |
1682 | xfs_trans_cancel(tp); | 1680 | xfs_trans_cancel(tp); |
1681 | if (error) | ||
1682 | goto out_free; | ||
1683 | 1683 | ||
1684 | /* Now iterate the list to free the leftovers */ | 1684 | /* Now iterate the list to free the leftovers */ |
1685 | list_for_each_entry_safe(rr, n, &debris, rr_list) { | 1685 | list_for_each_entry_safe(rr, n, &debris, rr_list) { |
@@ -1727,11 +1727,6 @@ out_free: | |||
1727 | kmem_free(rr); | 1727 | kmem_free(rr); |
1728 | } | 1728 | } |
1729 | return error; | 1729 | return error; |
1730 | |||
1731 | out_cursor: | ||
1732 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); | ||
1733 | xfs_trans_brelse(tp, agbp); | ||
1734 | goto out_trans; | ||
1735 | } | 1730 | } |
1736 | 1731 | ||
1737 | /* Is there a record covering a given extent? */ | 1732 | /* Is there a record covering a given extent? */ |
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 35c589a04fac..ea39e2bdc96a 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c | |||
@@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block( | |||
747 | 747 | ||
748 | /* Can we find any other rmappings? */ | 748 | /* Can we find any other rmappings? */ |
749 | error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap); | 749 | error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap); |
750 | xfs_btree_del_cursor(cur, error); | ||
750 | if (error) | 751 | if (error) |
751 | goto out_cur; | 752 | goto out_free; |
752 | xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); | ||
753 | 753 | ||
754 | /* | 754 | /* |
755 | * If there are other rmappings, this block is cross linked and must | 755 | * If there are other rmappings, this block is cross linked and must |
@@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block( | |||
779 | return xfs_trans_roll_inode(&sc->tp, sc->ip); | 779 | return xfs_trans_roll_inode(&sc->tp, sc->ip); |
780 | return xfs_repair_roll_ag_trans(sc); | 780 | return xfs_repair_roll_ag_trans(sc); |
781 | 781 | ||
782 | out_cur: | 782 | out_free: |
783 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); | ||
784 | if (agf_bp != sc->sa.agf_bp) | 783 | if (agf_bp != sc->sa.agf_bp) |
785 | xfs_trans_brelse(sc->tp, agf_bp); | 784 | xfs_trans_brelse(sc->tp, agf_bp); |
786 | return error; | 785 | return error; |