From patchwork Fri Jul 29 17:12:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12932721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E8FBC19F2C for ; Fri, 29 Jul 2022 17:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237576AbiG2RMQ (ORCPT ); Fri, 29 Jul 2022 13:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233332AbiG2RMO (ORCPT ); Fri, 29 Jul 2022 13:12:14 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 413646C12E for ; Fri, 29 Jul 2022 10:12:12 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id m13so2796021wrq.6 for ; Fri, 29 Jul 2022 10:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=nBMbWzVHMqXzwLlnW7jnIh9hCfJABd4syF3NF23qI1I=; b=UJ1s3XdZbAUnAIpctpGpeNILg5Nuhx2Tjoj+RfnOoGoV4W/+3nr78jj6beBxo9TqTd 5/S4fnLF8abIsDi1aZG/FHxNLduik0vXKX3Xgimedj5D01xy1+9FUedEuS45yujz8wdR r6AosuiqVfy1SPIGjFK8vc9jclxJv4V3Uovj1sFX/l8kMUv0/tHX56iD+D1fYF7eGraI DoVnX65OH3ftCiIWqL0KqI4HPYj2UlWalYRCS18Aby0KWDl3w7lx+b+bP3IG+Qzaox8E IJ/OlAa0WGO8U44f/420YunYv4wFVfpReJ5z+Ad4Dq//EAQamUu4SJTBrbMxFmElusn6 QzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=nBMbWzVHMqXzwLlnW7jnIh9hCfJABd4syF3NF23qI1I=; b=7hGG/YJHbl9GaFNMUplmnXrF4QyOsZn7H7x4JVuGOQfS8c4aAZJZPi+QbK8OgOoam6 qwumZHOTUFmZ3V4MYQ1ZDlNYUtx645A5saf+sVxKXU7DPHkqFXkSlGtaUvMsgSggf2P5 LhsfdoqpRf3CzwDspH9y/Hh5pwXAV9uUR/UbupfIadCiXaFTveaV4ZhGTV2dfIRWGv6D TxdAuiNQDf4Itnpj9GnyOxn43jf9cOuqIrN0kYCbUKrJMKd+TRDvBT65Yv64gxm0/S9G y0rPJkiVavpydhUFqIvvk2AUTBF316Rt9eQG6TRz6QKnqBnq4RntVeqLNY+4B2eLQOxk 1l3w== X-Gm-Message-State: ACgBeo1XtvUWwgPW111ygm9R4i/6lMfe5EhF/RjWYWecVdTkxRc38Sep Ycs/m6oBRD+goIdpIABTv5BuUmZ0EEU= X-Google-Smtp-Source: AA6agR48sePHFiNYXIYXd9Q+gjbuh+pbCK1sZogpOFb0AZy/KK5wBUbK/aLzN0d9weGnmLR1Yb7tww== X-Received: by 2002:a5d:6b43:0:b0:21d:7d01:b314 with SMTP id x3-20020a5d6b43000000b0021d7d01b314mr3180059wrw.357.1659114730110; Fri, 29 Jul 2022 10:12:10 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i16-20020a05600c401000b003a305c0ab06sm8783517wmm.31.2022.07.29.10.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 10:12:09 -0700 (PDT) Message-Id: <082c7ffa41f241c61ae2fe5ab763fb09c680a17b.1659114727.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 29 Jul 2022 17:12:06 +0000 Subject: [PATCH v2 1/2] merge-ort: clean up after failed merge Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 9fefce68dc8 (merge-ort: basic outline for merge_switch_to_result(), 2020-12-13), we added functionality to lay down the result of a merge on disk. But we forgot to release the data structures in case `unpack_trees()` failed to run properly. This was pointed out by the `linux-leaks` job in our CI runs. Signed-off-by: Johannes Schindelin --- merge-ort.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/merge-ort.c b/merge-ort.c index 931b91438cf..e820e45a8e8 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -3157,6 +3157,7 @@ void merge_switch_to_result(struct merge_options *opt, if (checkout(opt, head, result->tree)) { /* failure to function */ result->clean = -1; + merge_finalize(opt, result); return; } trace2_region_leave("merge", "checkout", opt->repo); @@ -3167,6 +3168,7 @@ void merge_switch_to_result(struct merge_options *opt, &opti->conflicted)) { /* failure to function */ result->clean = -1; + merge_finalize(opt, result); return; } trace2_region_leave("merge", "record_conflicted", opt->repo); From patchwork Fri Jul 29 17:12:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 12932722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF0FBC00144 for ; Fri, 29 Jul 2022 17:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237610AbiG2RMS (ORCPT ); Fri, 29 Jul 2022 13:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235560AbiG2RMO (ORCPT ); Fri, 29 Jul 2022 13:12:14 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C108D6C13B for ; Fri, 29 Jul 2022 10:12:13 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id c22so2864403wmr.2 for ; Fri, 29 Jul 2022 10:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Zwo/8FRaAsRfmRY6byv+l42XZPVwXQJhp9yYbuihb90=; b=jA48QyIOuaVa59HEXNBJhAA6NLsGjz8KCVhy7+s3F2N5VB0X6nlAp4+YJ29OPpWdYF /D0UiYWM0adLsp0Yej/6EDIWbzlZTUqWesR7QTzS1bxHzJsBcmYs1zS/4+HFbFEWBgVP Chy2arCY+R4KvBGxDuJeyC4elvrJuVx0Rm3qNfCrFaSBNRS0wVAiXUlNszVE6No0++AS ZzSuH6ShF1Ms1CEmUazX0L1QFK1XjU1S7AufirGyw3NSP5rGsz9OsAu7g+uFa2bxfqmJ knuve9qON924e4eLGTiCRkZR7e6EMS1alktfhk4fLmMqRnL6ZS3EsA46UFXIGUI5XWP/ vAIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Zwo/8FRaAsRfmRY6byv+l42XZPVwXQJhp9yYbuihb90=; b=Ce1i57TMCCOYfN+d4ScXLmtG7S7JLezG73FfkM5+SAOuGySN62j/dItvywYDCrRtAE krExXGAifivPxvlMiX27v1AUEL/Dj0Y0Kz29+iOhcIAsHvP4xoWndQHKZbH3sDYBlvi5 kyuHjBPDQFmVlzIR5ZwHBDWZEKZHmuCDR1DXcyhd9Diu4vbjw1sGDIml3pWH2lsy+AAV re8ccqsDl+SEvWSkGkUrkYFHq/pFb0CCyv6RPXz7sPkUfhU4Fehtnpe69kypUPkQs6kH 4BeZbKzj6XhRE64qpAoj5eEn5wcgXPkAuyCCiBXfrtNu83fYmNkW7RGLhtq9qJh1ihpq lImw== X-Gm-Message-State: AJIora/bU4cH0kUS8nZjbyURdD0stvB07/V/xyFtZ5Jp5mNl3WtPzTdl I5eQ9PvG9odGNOOuAormaHu9lTa1YXE= X-Google-Smtp-Source: AGRyM1t5sSIffYXGk+J40JJy8ipmQtt3qtCZ+MSbnu4Z63RaP3KCjr7IUm8e1Rk9zzEkZzFb0cdmQg== X-Received: by 2002:a05:600c:4e94:b0:3a3:4448:62cc with SMTP id f20-20020a05600c4e9400b003a3444862ccmr3167925wmq.108.1659114731337; Fri, 29 Jul 2022 10:12:11 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b2-20020a5d45c2000000b0021e9d98bec4sm4143855wrs.88.2022.07.29.10.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 10:12:10 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 29 Jul 2022 17:12:07 +0000 Subject: [PATCH v2 2/2] merge-ort: do leave Trace2 region even if checkout fails Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 557ac0350d9 (merge-ort: begin performance work; instrument with trace2_region_* calls, 2021-01-23), we added Trace2 instrumentation, but in the error path that returns early, we forgot to tell Trace2 that we're leaving the region. Let's fix that. Pointed-out-by: Elijah Newren Signed-off-by: Johannes Schindelin --- merge-ort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/merge-ort.c b/merge-ort.c index e820e45a8e8..eb0296902ad 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -3158,6 +3158,7 @@ void merge_switch_to_result(struct merge_options *opt, /* failure to function */ result->clean = -1; merge_finalize(opt, result); + trace2_region_leave("merge", "checkout", opt->repo); return; } trace2_region_leave("merge", "checkout", opt->repo); @@ -3169,6 +3170,8 @@ void merge_switch_to_result(struct merge_options *opt, /* failure to function */ result->clean = -1; merge_finalize(opt, result); + trace2_region_leave("merge", "record_conflicted", + opt->repo); return; } trace2_region_leave("merge", "record_conflicted", opt->repo);