Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp699771lqb; Wed, 17 Apr 2024 08:22:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5INwMQZ7wl25Z82VwGPckiGoU2dKWsWsMWFUW1bveY+07J9hcerSiGfPKAolF16CthPcTTH15wkTlRLbYurt+c7fIgWHDNoYmhUljCQ== X-Google-Smtp-Source: AGHT+IGjmKyCQO1GqcOwKp6uOuf3k8CbEket4NzLWWYsfHwdg9w+WJLVXxCUJPgchssxd70TtoqY X-Received: by 2002:a05:620a:e07:b0:78d:643b:e977 with SMTP id y7-20020a05620a0e0700b0078d643be977mr16907843qkm.19.1713367353523; Wed, 17 Apr 2024 08:22:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713367353; cv=pass; d=google.com; s=arc-20160816; b=gV+tpPwGC/2bjVvyeDQx/gspMAawqol0TvIVCtsQa3cui2CPPYs6W2sVTTu2CvtMSd zu3MjZHtbNMSvYfNST1VDlVVeBAvantET60iFMDTXWtp/qA2RS5On4uVtUaMbk2bD+ym yaXrrGO1cfEyGJXJVd4dMizw6yB+RKRJABlNyTm4EunnO+IYc4o6D58k+G9h32FoDQUn Bv1XYMivepb/ijuqJx0tDBAVwSbUJhck6eMtjZH4yrQeNxhKlUgM3+O0U1fQYeGqaoqJ 6rQOiCgoQCqt4TUmbkEEMnHQA7T53eV0wsKxubZ2vdeZaJcVVU725HF414EwTcLuz0c9 FFNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=BLIVN1Q8Utu3vhhv8cq7Y/8Y2OqVH+zhvtmCYbtTudY=; fh=YZJ3A+IlFPB7wD0imqoW2kvZMUI8z8XG9mXF0O8hTLU=; b=0gAbVg/ch4Cm9CgJ86sJqoeMwpGXUxMB/ndd36sxFDZnXAzc1P9HillnD8mm6cT1lG m1cOMRB0TUOD8Wsf2y9DFEJZ+pu48bFSUVKVajtRbfNxOqNqUzJogL/SWP4Fmy5rO5Kh 6g05t+HiW0y/AXzZjWhCOnMbq0T0r/y1fG8J4lRIXfGXKEczk2njAvSUIS3Nlrabu6tl VRy/nuhacnd4QqqNBc+a3KmIzDuBjfy9DG5eS0Mtwymzty7tJF3QM+zQYy9WOYVDOVCv KIwb4x1XdiIGkh4w1L0ldeF3XuvLR67WLn4vlbFepo3x864AxXSGwB0pAwZH/lrWQ3ku Cr2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pGNVU1Ip; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b7-20020a05620a04e700b0078ec6558098si14236934qkh.48.2024.04.17.08.22.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 08:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pGNVU1Ip; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 40D7A1C21971 for ; Wed, 17 Apr 2024 15:22:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD81E1474A6; Wed, 17 Apr 2024 15:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pGNVU1Ip" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DFF8212FF8F; Wed, 17 Apr 2024 15:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713367347; cv=none; b=mBUwmm62uqX2LO8vbFLRyM5ZzobEDq1XL7nDm6WnmSqsFnyZFvNLTHTFaOBEwvxTdUvz9OkEpc3eLDDqHVuhPebdefgYu33jy4Nnd23Z7Jvc77ib42An6vMdmZ3aHseBuiklf1xAlWD+wJunRkzR8JdFY67t18HCQ4YtMA++WUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713367347; c=relaxed/simple; bh=R7eexDiWtpHE6pflmf16kCzGylzB9hhf1fHTGg8yAnY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=k5fLfItviOy2f4zmfdYRECgvSwN610kNsAVuKP+ZZefeyVRMH2LSK+mWBsB0ztrXCA2ECl6OLwDd+VMYc9+cgIGRdrvX3rdEjuYk99Ntbkqu8tOSPMd2qvl5nsO/VDcSsPecgoOA00JAP3oYxROfDtlD4xNWSCHhVJ76Gn6AiNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pGNVU1Ip; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47C87C072AA; Wed, 17 Apr 2024 15:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713367344; bh=R7eexDiWtpHE6pflmf16kCzGylzB9hhf1fHTGg8yAnY=; h=Date:From:To:Cc:Subject:From; b=pGNVU1IpwXIU5PqjzgTBDHQe330aAY9WNuWKz0D/aZk/u7eZ3CqVNAarfdLsMzE5U 3UJ6utn397gm2ZQQvP1C495FjuykPn4b+lGfDaEsAQOHqhbEIGXeTQmdEaErEQrey8 igIzn5LX2r7vgWodYbKf3KOJyFvqF1W+ttc7kk9nN8ri+lfBe4GPTPqumrTOxr8hSS RONTUwqKXeEIH4pxuj4KSfFhucFitX+rVz83a8DWLudptxnAykcaKyWIogi10STXbn J7Sx12QW3Qey3ovlVLzUGwgLeeZhsa7HxAS8u6mf2WO+SjnaDWfrypZtgNCvpizngj wFM6GKevhtvXw== Date: Wed, 17 Apr 2024 08:22:22 -0700 From: Nathan Chancellor To: Christian Brauner Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: tools/testing/selftests/clone3/clone3_set_tid.c appears to always pass? Message-ID: <20240417152222.GA1517581@dev-arch.thelio-3990X> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Christian, I am looking at tools/testing/selftests/clone3/clone3_set_tid.c as part of a patch to clean up the uses of 'return ksft_exit_...();' throughout the selftests (as they call exit() so they do not return) and I noticed that it seems to always pass even when there may have been an error? if (waitpid(ns_pid, &status, 0) < 0) { ksft_print_msg("Child returned %s\n", strerror(errno)); ret = -errno; goto out; } ... out: ret = 0; return !ret ? ksft_exit_pass() : ksft_exit_fail(); } Should the ret and out label positions be switched? Alternatively, it seems like ret and out do not have that many uses, perhaps it would just be better to call the ksft_exit_...() directly in their respective paths? I am not going to touch it as part of my patch but I felt it was worth reporting since it appears to have been there since the introduction of this test in commit 41585bbeeef9 ("selftests: add tests for clone3() with *set_tid"). Cheers, Nathan