]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/xfs_refcount_btree.c
xfs: fix transaction leak on remote attr set/remove failure
[thirdparty/xfsprogs-dev.git] / libxfs / xfs_refcount_btree.c
index 167b1fd1159ae5bedb30fb7aed91c356d86b5756..04eb0232c5cbfc586a435aee971a65a568dc7961 100644 (file)
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2016 Oracle.  All Rights Reserved.
- *
  * Author: Darrick J. Wong <darrick.wong@oracle.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 #include "libxfs_priv.h"
 #include "xfs_fs.h"
@@ -40,8 +26,7 @@ xfs_refcountbt_dup_cursor(
        struct xfs_btree_cur    *cur)
 {
        return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp,
-                       cur->bc_private.a.agbp, cur->bc_private.a.agno,
-                       cur->bc_private.a.dfops);
+                       cur->bc_private.a.agbp, cur->bc_private.a.agno);
 }
 
 STATIC void
@@ -84,7 +69,6 @@ xfs_refcountbt_alloc_block(
        args.type = XFS_ALLOCTYPE_NEAR_BNO;
        args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
                        xfs_refc_block(args.mp));
-       args.firstblock = args.fsbno;
        xfs_rmap_ag_owner(&args.oinfo, XFS_RMAP_OWN_REFC);
        args.minlen = args.maxlen = args.prod = 1;
        args.resv = XFS_AG_RESV_METADATA;
@@ -191,7 +175,6 @@ xfs_refcountbt_init_ptr_from_cur(
        struct xfs_agf          *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp);
 
        ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
-       ASSERT(agf->agf_refcount_root != 0);
 
        ptr->s = agf->agf_refcount_root;
 }
@@ -337,8 +320,7 @@ xfs_refcountbt_init_cursor(
        struct xfs_mount        *mp,
        struct xfs_trans        *tp,
        struct xfs_buf          *agbp,
-       xfs_agnumber_t          agno,
-       struct xfs_defer_ops    *dfops)
+       xfs_agnumber_t          agno)
 {
        struct xfs_agf          *agf = XFS_BUF_TO_AGF(agbp);
        struct xfs_btree_cur    *cur;
@@ -358,7 +340,6 @@ xfs_refcountbt_init_cursor(
 
        cur->bc_private.a.agbp = agbp;
        cur->bc_private.a.agno = agno;
-       cur->bc_private.a.dfops = dfops;
        cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
 
        cur->bc_private.a.priv.refc.nr_ops = 0;