From: Filipe Manana Date: Tue, 10 Feb 2026 12:08:56 +0000 (+0000) Subject: btrfs: remove pointless out label in qgroup_account_snapshot() X-Git-Tag: v7.1-rc1~231^2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=521f8672b6b34a8959f8b5a5859364e52aa1ba8a;p=thirdparty%2Fkernel%2Flinux.git btrfs: remove pointless out label in qgroup_account_snapshot() The 'out' label is pointless as there are no cleanups to perform there, we can replace every goto with a direct return. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 77249dcbd7b4a..2df80452b0b74 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1602,16 +1602,16 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, ret = commit_fs_roots(trans); if (ret) - goto out; + return ret; ret = btrfs_qgroup_account_extents(trans); if (ret < 0) - goto out; + return ret; /* Now qgroup are all updated, we can inherit it to new qgroups */ ret = btrfs_qgroup_inherit(trans, btrfs_root_id(src), dst_objectid, btrfs_root_id(parent), inherit); if (ret < 0) - goto out; + return ret; /* * Now we do a simplified commit transaction, which will: @@ -1627,23 +1627,22 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, */ ret = commit_cowonly_roots(trans); if (ret) - goto out; + return ret; switch_commit_roots(trans); ret = btrfs_write_and_wait_transaction(trans); - if (unlikely(ret)) + if (unlikely(ret)) { btrfs_err(fs_info, "error while writing out transaction during qgroup snapshot accounting: %d", ret); + return ret; + } -out: /* * Force parent root to be updated, as we recorded it before so its * last_trans == cur_transid. * Or it won't be committed again onto disk after later * insert_dir_item() */ - if (!ret) - ret = record_root_in_trans(trans, parent, 1); - return ret; + return record_root_in_trans(trans, parent, 1); } /*