Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp523660lqh; Sat, 4 May 2024 10:17:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUav1ip5jf2nlpC330ZBWXpu5cWtRZW8rapKjyhXp3TBVG9Bva+xz5pAKF5LlXN9GYmBBEfGYPkTVAzJBKHZ8TetU5t1mJMzTfW6YDAtA== X-Google-Smtp-Source: AGHT+IE2HJnLdCZ9vEQGIJRtbkqFPpk5TkZ/rzpua9mDn2p+mcs0dVzlVY7MIAoTscuu+e4HZr9E X-Received: by 2002:a05:6214:76b:b0:6a0:c39e:8c54 with SMTP id f11-20020a056214076b00b006a0c39e8c54mr7630145qvz.33.1714843040847; Sat, 04 May 2024 10:17:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714843040; cv=pass; d=google.com; s=arc-20160816; b=yyO1j1C1RfMeT2wy6JtWr+K+zzMpL7QBSKD6xwrQEP5YoeC4m0V/EADP5yhPmkI5+v JK2X/t0wtIbyJ+tvS5wT0HJUkzjfIngJ+dwNr09IxSUjTUoVVE1Si5DKqHoGM8bXVTu7 SgDZAFjO+LkI7t0kiMRuYuRkf/w/2uIUhhRVnfl8xtKysdMRAfp/VQw0ZsTsvsfhPuPg s6mx8/fMomJ+jB3hCbpJUOxZPTpVqhJ9llWAcWo7k3rihAIMIduBAKFm6kks5WbAGP7x baxAEHXqtaqNvEjTVMvG5wtHvoyVs3F7DHf4bUx5KzSBbmJ/MSN9mccZOxOoYVfcIaNM MpFg== 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=Y9B1yS7dr1hXa9Yb30wcZ4uAWT7TVNCN9CZxLiBerBs=; fh=gQ9gCE2zZtPmStTQxeJ5wfg/UjRONxSa2d4tiSpYqYs=; b=oxZnueMvXj+IPvMaPB3SdutoZFCKw3Z5R+ml7tPNbzc8xdDiTMfHngfOFQNACiJWW5 qNdTVZSdwkkEpQ8BpdUgvc7uRFoi2RnpLNVG3eGzbjNvuGWzRCWiWZK4XdF1Yt6z83OM rGNo1bJaMIoSnJUuWoNZtOMWu+6gmi/kfO8F8D4MwzqPLsCkeRDmiZAyagMKC6ftpUS+ FCaN6Q293hoWMqngJxFvdEfkimY4zD96QmBNOgYGW0B3HqZ8TDP1/YhWNM3EcKpCmerV of9WRnnSfPo4bNlqh/BFPsVGoQw+PomnH8xDY78ME5I6lFupZx38PzfK+owEgErKqVvu MJCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mX4cAUdE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t4-20020ad45bc4000000b006a0a990e9f9si5811462qvt.583.2024.05.04.10.17.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 10:17:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mX4cAUdE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 907F21C20DC3 for ; Sat, 4 May 2024 17:17:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 396DE5CDFA; Sat, 4 May 2024 17:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mX4cAUdE" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 DAB281E871; Sat, 4 May 2024 17:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714843033; cv=none; b=IKOhb0UsvGtDkMLVgZKE0bZUiuEGdRZ+inqLjiHEgmXuos85Lkp+fKEYfOvv1nPDzQWklhnXGWRVxZ6frTDV0ZtSt14NErLwWWHHhdADiZMvVBvahTxE1oa18eY07ZSIFBMf+flN+BFBFku8xpNcnmvtqkMaNAQz3qhL0INyR18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714843033; c=relaxed/simple; bh=CHwURKhOVjoyYyUjhiWmlLKA/tlrP8KbElQ4Ku0JlQA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WMstSrXwmI+ZpkpHhy8oLwjhUyLCk9Cmt3aHVSIUJKfHA4mW3+iD2Hs7myVIAndc+l7LTfW/Ru7zjSDYSlvga2p04v9r4q02ckFZvAjnupNjrhTssYY/U9Un+qsxeIz19JUf5KJ5eM2n/j0/U2CKa6I2Fd64XgPLqSj8HybieNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mX4cAUdE; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a5200afe39eso144757466b.1; Sat, 04 May 2024 10:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714843030; x=1715447830; 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=Y9B1yS7dr1hXa9Yb30wcZ4uAWT7TVNCN9CZxLiBerBs=; b=mX4cAUdEPcCZdw6os1N1G+0pqOoFaTRjkJISg7DqFy2ak7uCOoh6buVFJnrlsQMYsy pVfwPoUKnYrxm5JngYo96XSzv2rc78uaZUtaoKUQO+oPZzoqTX9dJbkAnpn6FQMZndK+ 9ro5uJZgHRQCEV2VbyIOM6NKWciNKnTmArhlmpKHg69Qv16Pylo2W4DFKJAKa+nbJ3BV AXbIgRsS2Q6+wN2rajQS4WOjyn7c0Bu8yuzJEKFL9Md7LdsG61hswPrFT6QrUfdYuckT M7EcsGasr8xRvtwZUzXK9mtV0PkzYKNq1G+WMygeyvDCYzwlWsRCKvElm6nsCCEYKuT+ wEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714843030; x=1715447830; 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=Y9B1yS7dr1hXa9Yb30wcZ4uAWT7TVNCN9CZxLiBerBs=; b=R9eN4y81V3aCLt20q9aDu1ap/iKYxk16hPG9YBvSjFgCBAu3pd3W7cHknenhMB5CIl 4cB20qbFV9zahStahBjEkX5X620TAngAWi+nLX9o24tRo3B4Zukv3fgJ9zKRvMuHDRD4 PP7aXaYNxR261Qbauqjd6r5S4mZy+Xp+c/RNEGERsgG1FLpyTvHDElT83lZMY+nKQ1MA cJC+ve6JaOltmSYSQb+fjAodFaMWEl9rhQoSsQ3fite65L7U7z7oOOEw2CQKokSI+HZX +xyoNh1kqmucJ1dTuKekPn2LglGXrDuajVPWhhJeQBlRjqrsnWLjtPvH254xT8lW/yuB AQPA== X-Forwarded-Encrypted: i=1; AJvYcCWVk+CB9WtymTs4ARRxt2Yp3ssNgsQfXeTdCCCwoVsIcUkEIdtNOC9i2P+qXD4G1zVKW34UIaGTL3rZFGDdYW4efAUmIPQBbrP6GFSeCuyjH96ruvUeJbcy+Fd8GXpAOR3Ua0xGxKllJm1UQQhs X-Gm-Message-State: AOJu0YzkxbdrR+6o5X9NYE/mQ7OXBo7YsIJoqaJMWjSpnDjThIop3AFM A5LgZOaZSBQhHOpnL6xmlDUPA1AC8V12A9xTjjE44gznwVE/Hq67qmYZgxaPwcZGsM6B X-Received: by 2002:a17:906:7acd:b0:a59:70d2:91b7 with SMTP id k13-20020a1709067acd00b00a5970d291b7mr4950325ejo.13.1714843029767; Sat, 04 May 2024 10:17:09 -0700 (PDT) Received: from [10.67.234.135] ([194.110.115.30]) by smtp.gmail.com with ESMTPSA id fw14-20020a170906c94e00b00a59bf41edbesm318ejb.146.2024.05.04.10.17.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 May 2024 10:17:09 -0700 (PDT) Message-ID: <0910d537-c2e8-4932-8b0e-b5ce381e1ee1@gmail.com> Date: Sat, 4 May 2024 19:17:08 +0200 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: Muhammad Usama Anjum , Shuah Khan , Christian Brauner , Miklos Szeredi , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Javier Carrasco References: <20240417184913.74734-1-amer.shanawany@gmail.com> <58e0539d-423e-42e0-9ee4-8fc8e1eed94f@collabora.com> Content-Language: en-US From: Amer Al Shanawany In-Reply-To: <58e0539d-423e-42e0-9ee4-8fc8e1eed94f@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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