Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2042149lqa; Tue, 30 Apr 2024 06:58:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxgpaoiDoGmrHOdkPHGI65aGmlHxDBW67mrsqF2eNymdAZX26gIG8yHmRi8zGuM5I2lrvpbOw+or8hqMS/6AhrewtxrYJDs88rsU7aWQ== X-Google-Smtp-Source: AGHT+IEENxABCC5EzbXE4DmnkqtD9pJL/RioVrGPNKcTipXw2gmBxDNbxaBWZH7w32KEYDRe+8eS X-Received: by 2002:a50:cd8a:0:b0:56b:fd17:3522 with SMTP id p10-20020a50cd8a000000b0056bfd173522mr9592610edi.14.1714485508483; Tue, 30 Apr 2024 06:58:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714485508; cv=pass; d=google.com; s=arc-20160816; b=HmasLJZfCX6rTlyiSsfoJGivUOIfsHlutVKYiNLMgjqhXz/Qi++EtQ9Z6yQLbd5Xwc mx/bMDfg1wQvlhRMg3Hcue3ZjIY/hwKTYyjJD2YPtNCHKnN5qCt/2IXeWBHHQmN6DM76 vX9eEhWU2p7IxX5QJZlHaAYH6tYyEO3KLoXIQIph97WLMyb6+qHwJnjoabNC6VcTV4Qu TiJVBMqDsXXReZhjwUINA4obIwI7h5laEQH7iMaTBtCK9qaUNeuthfNO4S7IIgk5qiat a0eMinlpTLMTjfOC8Zii3STeNk1uG/491nrX/9BHKDG+Sx7wSt1sB4trYjHcC9hwdXJN 01rA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qbAciLeLTCBdTqrcduQYSBELewIvhU+8/KyBIYk2KhM=; fh=bA17tgKbI2VVEjfxqBmTjc97vVmsPg5eH+7jJ/KvfBI=; b=ucA1AcXR42r4+Q1DlTeotYAC8p5XdnFWs3liLr4LBl1xRUaJf6ljlsjiKEAMRIe2G4 EvLoPqlq98nDuHxKSzBsOgo3t6e54J85n7WPkog7BwYkofdRrYDIi9JKiHLLJyJLodZm MSyvlCEN5RtGz7JdetbtUhlPAWm6QfrmrTSRKdyYjJ7GZqGXTVsm0Al2/MwEEe3OnHBE j2BMTKFOK7zoDxCG78Y+RIbJvfxAFQYFktHooJy/PY59Xe5R5JDgLVYjw5MmuPcM3Q74 xGfvx6endOBxozIm8CbHz4a/YaP9dwm1Yi893Wcs54/2XoVaGqKINA0la/KBCEw9HZHP e8Kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QRObGC7y; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z2-20020a50cd02000000b005727926a0ffsi3513014edi.434.2024.04.30.06.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QRObGC7y; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3074-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 38C1F1F22B2E for ; Tue, 30 Apr 2024 13:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF4533AC16; Tue, 30 Apr 2024 13:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QRObGC7y" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75536171E45 for ; Tue, 30 Apr 2024 13:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485497; cv=none; b=B5EEFRnoaoNSy5HKEVmWNQkgOB82d0jL1yWT3YKKPJo2rbPKpy5jadEYtcqIl6i0lZUWZIjNEMECMIkkuWdviGkja5za17qT15wNht5/eKYhCGrckN7evCLCCpor76woGYKjWCSilaglQTghvE5N2Yvmh9thNbMx3UEtGwrBPcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485497; c=relaxed/simple; bh=OGgPvpOMkvuOBxBpj6FYHdfg2VxaauUnet7njuyAn9M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qO6yYIfU50NFgyYT3jGIhO6FHpCAdIugTThjhImwdVYt0IqcfcmbltoH0LenlsO7s9+lvzewkbfocIl0GNi+D2irgtoBc2RiVEfmQ5+SB5wsxyBHZza/IQZwa6LlR/03owfjNqeWY8fPSZ71uL3iPCGqg/KOgf+2kwIqRW9X9C4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QRObGC7y; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714485495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qbAciLeLTCBdTqrcduQYSBELewIvhU+8/KyBIYk2KhM=; b=QRObGC7yxqiA7UcL2ywVgswBUT38bpE/KLrlBMYtCTFNqQTlJkEeDLyi3YofNr19rEj9qo 62v5vuhxm3yVC3ryHgcBV3ctF6B8PYs1IjeWsYV0lzBGcvb+/2rri4r47dv0iy27qrtDEx DsO1rNAtZuMoXiaZSiO/tah8Hw+6yOw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-QO1trRxmN1ujv-IICE0LuA-1; Tue, 30 Apr 2024 09:58:09 -0400 X-MC-Unique: QO1trRxmN1ujv-IICE0LuA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9278812C5A; Tue, 30 Apr 2024 13:58:08 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.16.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAFEC492BC7; Tue, 30 Apr 2024 13:58:08 +0000 (UTC) Received: by aion.redhat.com (Postfix, from userid 1000) id 7674A149E54; Tue, 30 Apr 2024 09:58:08 -0400 (EDT) Date: Tue, 30 Apr 2024 09:58:08 -0400 From: Scott Mayhew To: David Gow Cc: brendanhiggins@google.com, rmoar@google.com, npache@redhat.com, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test Message-ID: References: <20240321143200.1854489-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On Sat, 23 Mar 2024, David Gow wrote: > On Thu, 21 Mar 2024 at 22:32, Scott Mayhew wrote: > > > > Commit c72a870926c2 added a mutex to prevent kunit tests from running > > concurrently. Unfortunately that mutex gets locked during module load > > regardless of whether the module actually has any kunit tests. This > > causes a problem for kunit tests that might need to load other kernel > > modules (e.g. gss_krb5_test loading the camellia module). > > > > So check to see if there are actually any tests to run before locking > > the kunit_run_lock mutex. > > > > Fixes: c72a870926c2 ("kunit: add ability to run tests after boot using debugfs") > > Reported-by: Nico Pache > > Signed-off-by: Scott Mayhew > > --- > > Thanks, this works well here, and is a good idea anyway. > > Reviewed-by: David Gow > Brendan, David, Is there a reason this patch hasn't been merged? -Scott > Cheers, > -- David > > > lib/kunit/test.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/lib/kunit/test.c b/lib/kunit/test.c > > index 1d1475578515..b8514dbb337c 100644 > > --- a/lib/kunit/test.c > > +++ b/lib/kunit/test.c > > @@ -712,6 +712,9 @@ int __kunit_test_suites_init(struct kunit_suite * const * const suites, int num_ > > { > > unsigned int i; > > > > + if (num_suites == 0) > > + return 0; > > + > > if (!kunit_enabled() && num_suites > 0) { > > pr_info("kunit: disabled\n"); > > return 0; > > -- > > 2.43.0 > >