Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp431634lqp; Tue, 11 Jun 2024 08:32:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqsygkmtlKeqlEU59JNt68YZO2bwrRLSkXKMXUDHGZ4m2OEWxlp4ImASC9XR7+YMgQcQ8+t/EkVlhoLn334KR0V2M/5ABsSS6+QwitLw== X-Google-Smtp-Source: AGHT+IFAuSA+lpEFPDcWgzXqbmUR8wd7xS9OTA5Fy/HTlUCwkhTD21I28+MswqlWxEN+4rk4ApuS X-Received: by 2002:a05:6a20:7483:b0:1b7:bdb3:7bc9 with SMTP id adf61e73a8af0-1b7bdb38093mr5746538637.30.1718119923928; Tue, 11 Jun 2024 08:32:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718119923; cv=pass; d=google.com; s=arc-20160816; b=rTNcTqXcZCNJ4i6kmo9BDYCrU3Xcy1GEzlYzkOgVfNuXvBPSjmLZVfGFDvZX7wSqgf R5SwM4DgRY61JO7j3wGh5njuxKEdDNiIHSjPhZyBiK9P/YRwH3HKtFvcuhMF3pxo83z+ BRMR2+04ATcRFHsIMxv/foCoFJulSIC9h2WvbgPIwCM6KpB8Hypk6hqpEz2ds8leBndj UDVptVj2lS6nooaA0250A9R6Y3Xugf5iZqck68/BfCujpI303LzkMNmbCQFTRikyirhP Qpy3WZG1lYTt+6Hqq9buIeWsdJvft/YbOZzGkvToWkbZ6uc4hyZNZVNprZFna0DnYz1C p2Rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=QgiG88rmAe4hGOcOH9NukgYDWLNdDqncNF+Hnp9N4/k=; fh=8POgq/x0niZngT6I/jDpy3AGdeEZAcdnIxy+2KQdj0o=; b=oaReTXR3a+OaqSHei/ljVYzVZrqXzIZs/1fTkzDTVUM9nadZwUfytAIYQnEda/DjLz 3wWM5/uux/xseYDycA9rEbsMR2vqyIq722TFeljlO2Ar+9fjHgCmuYm/OSi8mzF0xTDf gYS+NznMhc2mhEBq/DO4vZAgBUuMDY+UGh0V0v0Mqvvh73+mH8BmpocRSCM7vQ2+D4CC ZbtS8IMS3IkY+YZWVmuylQGRgesB0awUg78ljjXgfX6Hx9HEsWT2xIYe5XMsw3DGfZrM LzQKNpmyKRtLFOWuZhgVLpxcyLJ04+KdgYsqmh/6JTgFCMFGPjFdDr22iexomyUewU0i ZR3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ZK+Nl6gt; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210154-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6eb26acef3dsi4564177a12.852.2024.06.11.08.32.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210154-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ZK+Nl6gt; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210154-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EDBD9284EC8 for ; Tue, 11 Jun 2024 15:31:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10B9928399; Tue, 11 Jun 2024 15:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZK+Nl6gt" Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926D7381B9 for ; Tue, 11 Jun 2024 15:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119912; cv=none; b=O2MKxqAucqqSn8A91p7lOHxVptd6aiV463WANMig/zLCVTyv0vVMnKiuIiUifFXwr1//o2T0D89l7L2KXMiA0bChbu3hmdKSRzMXztNcI9GpKqH7FGX2RORZzVGIyyR5PUIp/QO1Ij1UnrpYI3SuAEtAd2mvQ/1fQhqP+37mAis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119912; c=relaxed/simple; bh=nb/41p5cqxyjZu+y4cWwFNmsrVjqoLEmHFNnJV6EqpE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ixv6WUy/1dqXGXjnaxXU4yOE67hqaKFQEEj2Nsc5Q1jbVzTdhuorlN+hOtjZrDzM9KdnjA2+EUpmr9q/e+4Ry6i6GMukTn5SFkdz9V7bVUajqQkVcQY+ptl62nL+fzJVKZb7qyNX+dVkgxq1WUYlD199fflt8/tBL2gUae2FUFg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZK+Nl6gt; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7957ab2ad40so8459585a.1 for ; Tue, 11 Jun 2024 08:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1718119909; x=1718724709; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QgiG88rmAe4hGOcOH9NukgYDWLNdDqncNF+Hnp9N4/k=; b=ZK+Nl6gtdw0YVGHn2MHxy4xGsmdCTn0xyogrFSyIso/kBVC3PGftNCr1o/uQa4ij5C s9FO1G/wpH1Ew7AnabDkGrPlaiGhRphEaERqrRb/GOBmD0WvgFhPr79d4fqFruSvKLpI X1188hhDVVU7m79TG7C4/QQ7V8ntC84v6kpBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718119909; x=1718724709; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QgiG88rmAe4hGOcOH9NukgYDWLNdDqncNF+Hnp9N4/k=; b=szfa69RsLL2tiN1Dp0HXVStY8DaUpYWCxtx4yz67HNc4bkRiWjJltAsKziBdJSMoCU ptexEAmTxpZwNCBcwRbuZpOkrd8uSzan5fDXiQUBxG8WOVkPVxLcL/CNvSwc3tbURFPt uy2rKET7/mxmvYJ+ZW9Z6dkveFQ+uI0pLIkGbn19c14a0sizMAJDrGsKuD5MMpWdiXHD xuymvfEvKh9bZX4E4qpSn+HZLL62ZoJuSo35KSP7Krk+kB0GdyobwrgcFVhGRYzgTjZL YLAFHYsY6q2PL/5tUEKgcuMNmHATIf8Dfdd5owyFm1m836vyoAc8RKSBRyb7kEa1HYCa irbg== X-Forwarded-Encrypted: i=1; AJvYcCWnj2kHwbyAhkNoaeqT4L16rnu4LHwTFI663qYgfGfprcxMkM/hrcH9/cTcEHm6ofAjknZuAVrjRvwqQPkOIAdgg1SuA9nH/04zwu4O X-Gm-Message-State: AOJu0YzZBoZuhsO3g2TSS3saCaF5tWRre7PZ27y0QehjKUId4cGD0oTV 1NBAusgPbasbnUGQF0F2mj5G48cHB5iIilbLM+yfpm46bZ/epOMotMIoIetU2VM= X-Received: by 2002:a05:620a:4886:b0:795:6b7b:6923 with SMTP id af79cd13be357-7956b7b6b78mr697052285a.3.1718119909316; Tue, 11 Jun 2024 08:31:49 -0700 (PDT) Received: from ?IPV6:2607:fb91:213b:a129:544a:cc06:ea0:4045? ([2607:fb91:213b:a129:544a:cc06:ea0:4045]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79558163eeasm299849785a.124.2024.06.11.08.31.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 08:31:49 -0700 (PDT) Message-ID: Date: Tue, 11 Jun 2024 09:31:46 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: filesystems: add return value checks To: Abhinav Jain , shuah@kernel.org, brauner@kernel.org, mszeredi@redhat.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: javier.carrasco.cruz@gmail.com, Shuah Khan References: <20240610200909.55819-1-jain.abhinav177@gmail.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20240610200909.55819-1-jain.abhinav177@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/10/24 14:09, Abhinav Jain wrote: > Add ksft_exit_fail_msg() return value checks for fchdir() & chroot() > to address the selftests statmount test compile warnings > > statmount_test.c:127:2: warning: ignoring return value of ‘fchdir’, > declared with attribute warn_unused_result [-Wunused-result] > 127 | fchdir(orig_root); > | ^~~~~~~~~~~~~~~~~ > statmount_test.c:128:2: warning: ignoring return value of ‘chroot’, > declared with attribute warn_unused_result [-Wunused-result] > 128 | chroot("."); > | ^~~~~~~~~~~ > > Signed-off-by: Abhinav Jain > --- > .../filesystems/statmount/statmount_test.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c > index e6d7c4f1c85b..b5e1247233b6 100644 > --- a/tools/testing/selftests/filesystems/statmount/statmount_test.c > +++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c > @@ -125,8 +125,17 @@ static uint32_t old_root_id, old_parent_id; > > static void cleanup_namespace(void) > { > - fchdir(orig_root); > - chroot("."); > + int ret; > + > + ret = fchdir(orig_root); > + if (ret == -1) > + ksft_exit_fail_msg("changing current directory: %s\n", > + strerror(errno)); > + > + ret = chroot("."); > + if (ret == -1) > + ksft_exit_fail_msg("chroot: %s\n", strerror(errno)); > + > umount2(root_mntpoint, MNT_DETACH); > rmdir(root_mntpoint); > } There is another prior patch that fixes the problem https://patchwork.kernel.org/project/linux-kselftest/patch/20240417184913.74734-1-amer.shanawany@gmail.com/ thanks, -- Shuah