xfs_refcount.c (f9e0370648b9f9908ec97f44459a1152aecbbf45) | xfs_refcount.c (a71895c5dad1ab8cf30622e208d148298ab602e5) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Copyright (C) 2016 Oracle. All Rights Reserved. 4 * Author: Darrick J. Wong <darrick.wong@oracle.com> 5 */ 6#include "xfs.h" 7#include "xfs_fs.h" 8#include "xfs_shared.h" --- 1163 unchanged lines hidden (view full) --- 1172 rcur = NULL; 1173 *pcur = NULL; 1174 } 1175 if (rcur == NULL) { 1176 error = xfs_alloc_read_agf(tp->t_mountp, tp, agno, 1177 XFS_ALLOC_FLAG_FREEING, &agbp); 1178 if (error) 1179 return error; | 1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * Copyright (C) 2016 Oracle. All Rights Reserved. 4 * Author: Darrick J. Wong <darrick.wong@oracle.com> 5 */ 6#include "xfs.h" 7#include "xfs_fs.h" 8#include "xfs_shared.h" --- 1163 unchanged lines hidden (view full) --- 1172 rcur = NULL; 1173 *pcur = NULL; 1174 } 1175 if (rcur == NULL) { 1176 error = xfs_alloc_read_agf(tp->t_mountp, tp, agno, 1177 XFS_ALLOC_FLAG_FREEING, &agbp); 1178 if (error) 1179 return error; |
1180 if (!agbp) | 1180 if (XFS_IS_CORRUPT(tp->t_mountp, !agbp)) |
1181 return -EFSCORRUPTED; 1182 1183 rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); 1184 if (!rcur) { 1185 error = -ENOMEM; 1186 goto out_cur; 1187 } 1188 rcur->bc_private.a.priv.refc.nr_ops = nr_ops; --- 467 unchanged lines hidden (view full) --- 1656struct xfs_refcount_recovery { 1657 struct list_head rr_list; 1658 struct xfs_refcount_irec rr_rrec; 1659}; 1660 1661/* Stuff an extent on the recovery list. */ 1662STATIC int 1663xfs_refcount_recover_extent( | 1181 return -EFSCORRUPTED; 1182 1183 rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); 1184 if (!rcur) { 1185 error = -ENOMEM; 1186 goto out_cur; 1187 } 1188 rcur->bc_private.a.priv.refc.nr_ops = nr_ops; --- 467 unchanged lines hidden (view full) --- 1656struct xfs_refcount_recovery { 1657 struct list_head rr_list; 1658 struct xfs_refcount_irec rr_rrec; 1659}; 1660 1661/* Stuff an extent on the recovery list. */ 1662STATIC int 1663xfs_refcount_recover_extent( |
1664 struct xfs_btree_cur *cur, | 1664 struct xfs_btree_cur *cur, |
1665 union xfs_btree_rec *rec, 1666 void *priv) 1667{ 1668 struct list_head *debris = priv; 1669 struct xfs_refcount_recovery *rr; 1670 | 1665 union xfs_btree_rec *rec, 1666 void *priv) 1667{ 1668 struct list_head *debris = priv; 1669 struct xfs_refcount_recovery *rr; 1670 |
1671 if (be32_to_cpu(rec->refc.rc_refcount) != 1) { 1672 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, cur->bc_mp); | 1671 if (XFS_IS_CORRUPT(cur->bc_mp, 1672 be32_to_cpu(rec->refc.rc_refcount) != 1)) |
1673 return -EFSCORRUPTED; | 1673 return -EFSCORRUPTED; |
1674 } | |
1675 1676 rr = kmem_alloc(sizeof(struct xfs_refcount_recovery), 0); 1677 xfs_refcount_btrec_to_irec(rec, &rr->rr_rrec); 1678 list_add_tail(&rr->rr_list, debris); 1679 1680 return 0; 1681} 1682 --- 114 unchanged lines hidden --- | 1674 1675 rr = kmem_alloc(sizeof(struct xfs_refcount_recovery), 0); 1676 xfs_refcount_btrec_to_irec(rec, &rr->rr_rrec); 1677 list_add_tail(&rr->rr_list, debris); 1678 1679 return 0; 1680} 1681 --- 114 unchanged lines hidden --- |