Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2181366iof; Tue, 7 Jun 2022 22:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8ix2pCn0NcPByk8teU32cgTlbu9tknT+6ZnpwgOAFb7866AXn3nIeo/xMggajD0NiiY9w X-Received: by 2002:a17:90b:4a8e:b0:1e4:e2bd:7ff1 with SMTP id lp14-20020a17090b4a8e00b001e4e2bd7ff1mr39372653pjb.58.1654665850328; Tue, 07 Jun 2022 22:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665850; cv=none; d=google.com; s=arc-20160816; b=dCW1Hhka8Wc28z78Uponkwi9uKN6kam/FQ6MDxnYqzb5+Eob2aQxxuquP6QVVtvvOR W3oksjnrUkmyVjXSK7s6urVhvjvnJKAP40BSvhoxKNJgLPUaQcUyVqZG+1KeDsELCjes D2jBhlIbAP8KfZBNVZQ8pv7Hjx+rQ659tA27xAjXYXwsU7drABOqnsGvJZGQzBcwEi0S LhX5OGF8Ol+szM4XCqSwMCxq/yU/ZtcJBoEUayiqXdnDlp2Rk2RDXqiwga1LxgvTPJ9W +ch1tb1kC/jrlyGNOjyjJY9t34aLOJjGLllJUhm7FlT8byN35HbxO9Bq3CCA3J9RKkvT 3NAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kA5FKJA5AdKrTop8jM4YtUqKvZiaE5gHO3WoJeGte80=; b=dh3a2NBSr81mHteNzvlaSFF6Tr4LK00j5bylnTbNVsmC+OMnCAqlE0lPQCY6hvHBOT UNqpWyWYC6xGeb3kxgTI/0TjSQbeuW6DNKxiMY80RHS3aT6ATl0zyKcVQA5sTiR9l6+U +GUeNICcU28xbp77nEFcOt1M7RZuLdPTARl0zTdlC6q1e4CZDzw9wK7kpKlp2R06DHDF GSaoB2iAcydw3e9x7u+NoHai6cQPQPQBoET2mIm/QQhkpD6vki/M7/OzXDMY7RdP7f3n BX2cJwiQ6j7ZiLq7+AYiroHFGCjoxECJi4hesi8c1Jqy3Uihehi2FNIu2IjA9ekeaa2Y 0k1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=05YYQWxl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b10-20020a631b0a000000b003fddd130adesi9024844pgb.92.2022.06.07.22.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:24:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=05YYQWxl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F71E470C44; Tue, 7 Jun 2022 21:51:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385100AbiFGWVA (ORCPT + 99 others); Tue, 7 Jun 2022 18:21:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380455AbiFGVQU (ORCPT ); Tue, 7 Jun 2022 17:16:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8927F21CBE3; Tue, 7 Jun 2022 11:55:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF83612F2; Tue, 7 Jun 2022 18:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06A10C385A2; Tue, 7 Jun 2022 18:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628102; bh=tO43DjKucU72pP0RHq0rgcL4dGdhO7HahM+k57aUjI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=05YYQWxlMZdE/e51i1W7QvRYMTIy4XPv8B6BBQQ+61nCuKqgext0e96Dlj8EtYuvX jc460Fsr8T9SlYaR9AGjJaTazkJGULiZ7isCvj54DYEtFti/yA9vE9waiTRSuxZv67 7t9wTzDA4F8bK8rMfn8pJuQbRWGhcvsxNCKXl6cQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Latypov , Brendan Higgins , Shuah Khan , Sasha Levin Subject: [PATCH 5.18 208/879] kunit: fix executor OOM error handling logic on non-UML Date: Tue, 7 Jun 2022 18:55:26 +0200 Message-Id: <20220607165008.887415960@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Latypov [ Upstream commit 1b11063d32d7e11366e48be64215ff517ce32217 ] The existing logic happens to work fine on UML, but is not correct when running on other arches. 1. We didn't initialize `int err`, and kunit_filter_suites() doesn't explicitly set it to 0 on success. So we had false "failures". Note: it doesn't happen on UML, causing this to get overlooked. 2. If we error out, we do not call kunit_handle_shutdown(). This makes kunit.py timeout when using a non-UML arch, since the QEMU process doesn't ever exit. Fixes: a02353f49162 ("kunit: bail out of test filtering logic quicker if OOM") Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/kunit/executor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 2f73a6a35a7e..96f96e42ce06 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -247,13 +247,13 @@ int kunit_run_all_tests(void) .start = __kunit_suites_start, .end = __kunit_suites_end, }; - int err; + int err = 0; if (filter_glob_param) { suite_set = kunit_filter_suites(&suite_set, filter_glob_param, &err); if (err) { pr_err("kunit executor: error filtering suites: %d\n", err); - return err; + goto out; } } @@ -268,9 +268,10 @@ int kunit_run_all_tests(void) kunit_free_suite_set(suite_set); } - kunit_handle_shutdown(); - return 0; +out: + kunit_handle_shutdown(); + return err; } #if IS_BUILTIN(CONFIG_KUNIT_TEST) -- 2.35.1