Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp426249lqp; Tue, 11 Jun 2024 08:23:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAQpVmnMyNuy+xhslYcExyTg0rZ5gemdEabUsbdtxvd4OZ5UNlvp5tq+iwx4lbpDiznd2VgOGcn3mI4bZz+EBCKAYk5+upBDe9L4U+vQ== X-Google-Smtp-Source: AGHT+IHXl6jm05jKpLUinBFOlMpbrLRxqY+jEueJK3ReEQo29N+q3QKX/RPwrNJezAhu7ALg2+bW X-Received: by 2002:a17:907:80a:b0:a6c:6f0a:e147 with SMTP id a640c23a62f3a-a6cd560f983mr1036127466b.12.1718119408739; Tue, 11 Jun 2024 08:23:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718119408; cv=pass; d=google.com; s=arc-20160816; b=Dn5xm+p3dbS0+RAgPWSDwCxPAYG2OOHFjEcB4R/PQ5YkfjTRgY0OMU8vsyMCxpDkvZ /Eutm8OVM2vzsLPGLDQ1kYzzvsU6u+83+AIQ1z17q81Pd9c7DSFRKMFbnTRvjFC+AazI STwvxQi8mTEGUGZeA5wdZGjQCrNMJdf1vqxnA8/Zl8clovMDtY7uAhXwmC6QsaMKIZkw xZJ/ZUGey9P/GPhX9fE/NdsyF5klVE1SacuByqKCnDYt+Tgjd7raEIPMitaLAMJmEX15 M8E0ygRZ4x+TQTIgEjYJHJtgiEVsYN4WRdIDeTR1Na2cPS0oBLzj0HdX2HDQdk+UXrBS x4vQ== 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=HdCqb4jwOd5pvnTn6Ox/jiqyDLoaZHnkqS07QEcqzS8=; fh=Cq3vJgI7EKaWY5gvu4+RCFpkCHj4SrMQLqculD+5J14=; b=Uk0fSddKDfPgszD+zPiOoLQFcwypYzxHVzDMTzjbY+4nXbhAoHS8ILqZTpOGfkiJgZ JSi4iRxFqVydscrBtYILnBCf9sAOJ1nyWCKYUfpnCnCiPdFhh3FWnCRYu5jDTafeMyFj xRn6BqqEKfmw+5aIRIzXnLL1ELFPqufg6zpQ6oP3KR9XZLBL0EasVWlKJtS05fRJ+FrY s4dcbIfCO5S8jgmUFCcjkpYqTi34yyp1k+HhY8a+EQ5mrOM1Im8WvG81S0bm7iMTSU0O REglWdD9EcrIqqCLkNB3tL1ytTlgh+rD1zxrIJ2Zl0sSX9N1uSNCfADPNlCbVMVwm2Or Xy1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KoCMf8Bv; 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-210145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f0b083c13si322753466b.1003.2024.06.11.08.23.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:23:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KoCMf8Bv; 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-210145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210145-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 77FF41F24684 for ; Tue, 11 Jun 2024 15:23:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8212025776; Tue, 11 Jun 2024 15:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KoCMf8Bv" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 EED212110F for ; Tue, 11 Jun 2024 15:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119402; cv=none; b=ZCOrZxNAi99OW+tuPm1zXySXVp8MLzSQ+jJmxYiBXC4BiIY9YvI4LpukT3/lPvXuMuvQstr0VOkUjz1rnY6sav9F5AmCTDIH/vmbaeOkusZLBx+FXL730Fbir+ftWEGfAvyXiUcOA9wleMt98TwJMsFDz/GHoEiS7aE1Zslz8oI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119402; c=relaxed/simple; bh=ZEJOzWLv67Lt9koj3wAP6SNyrkJMfABaIM3Sukt+QDo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lUpGBu0frxjZ23rXt1z6u+/9n79d9lRhDNBT+6o5l8zQ6oysjkZJymv6KTPwOHEcN8eXQ2abrqdVvHrLmdbiPGT7edCcuWZJ3tgsTILp0IWnAqOZ+DJZna+S+20+eO8t49D8tO08Knd8KMFoURMzV0FkV9h+L7MnTpyrQkEvYak= 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=KoCMf8Bv; arc=none smtp.client-ip=209.85.219.171 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-yb1-f171.google.com with SMTP id 3f1490d57ef6-dfb1ac0f03cso231002276.2 for ; Tue, 11 Jun 2024 08:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1718119400; x=1718724200; 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=HdCqb4jwOd5pvnTn6Ox/jiqyDLoaZHnkqS07QEcqzS8=; b=KoCMf8BvvVkBBxeWOcoScOs/UWAWHnNp8zu801CsFL/f9NUM3eW/fhXwJVCUe+gcEC AZjZ5W+mUPaZyZyxfXcQTjHmR2K3Bth4FFMGTDGAu+4F2l3WDYf3y++XuIQcwGBkm9Fs LNJC79ntThtW9/bEvE3vz0oPT//eF8Dbyepww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718119400; x=1718724200; 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=HdCqb4jwOd5pvnTn6Ox/jiqyDLoaZHnkqS07QEcqzS8=; b=jhxHu+qv/38mZpr9s1836p9jUO9GdJzfTbE4JF5uEtxNwBWrEL0SEnPu+4JwUXK9IG IKSzSQcGgH/WqvwgqkDUhMKKnRk9V66GUa1ZSZdhzGreWmFS+mEFvrlyfnt5+uJc5t0q 5tBQJ15pmf5XzRJeqDI3AEiM19m/xWrUZBEXWzESlY/wlFHiXKwynifSNGo2pPE2U32p r9cJiC0vNNeWqgO6jRi+wXFXFj8/mBCLIbEGV3tjAilef5JMx7cBcTpZKB5dDExjGxrE 8K8YswTeUey9nLw6kx4bJyFUI2S0LzzRpT098ZqX9kY08wYQJg54fg9z1EL8ZCVoc70E K8cw== X-Forwarded-Encrypted: i=1; AJvYcCV2ZHObIJxYRH+xzZtVVaKraseTaLzfPrAOJrJetE863hdmgwjqJrb7FhoA+DvaEZ9qxVh2vWPEUWzKxbA=@vger.kernel.org X-Gm-Message-State: AOJu0YyVIPg1b2e78uo6aEZTVAQhNuN/jG7y4AKfHBVptZqmH2Wq7Zk8 vV+QBo0f9Cuc0llH5R76Sgr6AERRHKyREuVd78ePvMegYhQGu4nkJGRS9vnP27I= X-Received: by 2002:a25:ab2d:0:b0:dfa:fcb9:8201 with SMTP id 3f1490d57ef6-dfafcb983admr10061824276.6.1718119399856; Tue, 11 Jun 2024 08:23:19 -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 3f1490d57ef6-dfb0823b4f8sm1469795276.47.2024.06.11.08.23.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 08:23:19 -0700 (PDT) Message-ID: <61f322f5-8b4b-4f5b-8226-e44846e10c09@linuxfoundation.org> Date: Tue, 11 Jun 2024 09:23:17 -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: fix warn_unused_result build warnings To: Amer Al Shanawany , Muhammad Usama Anjum , Shuah Khan , Christian Brauner , Miklos Szeredi , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Javier Carrasco , Shuah Khan References: <20240417184913.74734-1-amer.shanawany@gmail.com> <58e0539d-423e-42e0-9ee4-8fc8e1eed94f@collabora.com> <0910d537-c2e8-4932-8b0e-b5ce381e1ee1@gmail.com> <5dfdfa17-d3b3-408e-a8a6-b8dc0756eac3@gmail.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <5dfdfa17-d3b3-408e-a8a6-b8dc0756eac3@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/3/24 05:17, Amer Al Shanawany wrote: > On 5/4/24 19:17, Amer Al Shanawany wrote: >> On 4/19/24 18:41, Muhammad Usama Anjum wrote: >>> On 4/17/24 11:49 PM, Amer Al Shanawany wrote: >>>> Fix the following warnings by adding return check and error messages. >>>> >>>> statmount_test.c: In function ‘cleanup_namespace’: >>>> statmount_test.c:128:9: warning: ignoring return value of ‘fchdir’ >>>> declared with attribute ‘warn_unused_result’ [-Wunused-result] >>>> 128 | fchdir(orig_root); >>>> | ^~~~~~~~~~~~~~~~~ >>>> statmount_test.c:129:9: warning: ignoring return value of ‘chroot’ >>>> declared with attribute ‘warn_unused_result’ [-Wunused-result] >>>> 129 | chroot("."); >>>> | ^~~~~~~~~~~ >>>> >>>> Signed-off-by: Amer Al Shanawany >>> Reviewed-by: Muhammad Usama Anjum >>> >>>> --- >>>> .../selftests/filesystems/statmount/statmount_test.c | 12 ++++++++++-- >>>> 1 file changed, 10 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..e8c019d72cbf 100644 >>>> --- a/tools/testing/selftests/filesystems/statmount/statmount_test.c >>>> +++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c >>>> @@ -125,8 +125,16 @@ 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_perror("fchdir to original root"); >>>> + >>>> + ret = chroot("."); >>>> + if (ret == -1) >>>> + ksft_perror("chroot to original root"); >>>> + >>>> umount2(root_mntpoint, MNT_DETACH); >>>> rmdir(root_mntpoint); >>>> } >> Hi, >> >> Can you please consider this patch? >> >> Thank  you >> >> Amer >> >> >> > Hello, > > Could you please consider this simple patch for fixing build warnings for kselftest ? > > Thank you > > Amer Applied to linux-kselftest fixes branch for the next rc. thanks, -- Shuah