Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp765242lqt; Fri, 19 Apr 2024 09:42:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyYIyvpAI/EEm/y0HZgOMUWnCTnrDwmKMbWKpORtvJjNTp4xkU/GTGZHQWZoyTlE4LOC6ciBdLBieTw4NehbOUZYJQckMObMwIII5w+g== X-Google-Smtp-Source: AGHT+IELSIs5lkj1Mv6UW9uvaSWN60xAFO9nKMKQgEcwDF8TVM3i93BzY6C23CvrjuOadMapVDQC X-Received: by 2002:a05:6358:b593:b0:186:ea4:b1a3 with SMTP id wa19-20020a056358b59300b001860ea4b1a3mr3494415rwc.32.1713544924242; Fri, 19 Apr 2024 09:42:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713544924; cv=pass; d=google.com; s=arc-20160816; b=ERpLsoKHDMI1Si3ed2IUYXCnVjMuCF2OvpKQZ3g9E60wxpUmiGqn6Y+LOVbEv9frrK YxcF9XXRyIyjX3GWZLwOhuQ7vrNj56YFURby/Bic5m+qr8uD+x4/0kYssLtmAuyD19Qq nvN7GSoeTY2SELzSnrGZxIqagPxBjly0B24Lhl6St7MpH1vPSHkmO0CgnVcCQpxY2SVZ PU48NQfsI7yxSLMV6yppcOVIlMX/OClwWg4WpYML5STE/kjBxHg8Vpjc25NkVl1AQian y8RQm0Kyf5FA4Tq+iLdYQpUc1B6/e712o9aI5rPlN4jCU1Le0lSUHtLCjJUxiReYxFVq Xx5A== 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:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=WcENRSxKvDPd+JaRvL/I2m7TEFVIqdy7UaZKBhauLK4=; fh=NmcTkkw56Pu7YU9gAXLxqFSEjPi2bxLh8xjcgSQNd1A=; b=CrAddtcYUs3txXUeaWnelgD/6zo/fNDwMwbbTW0iXhWsIAQR6VwqHJ33nUtGPCDjpD nBv6kSBK5ZoW50Xd0pGv4F6IU08Gda1oshX5lSmWNBjJTX4nHYD/k8VlN1YvtM+7OLWo nel4YCOC0Cjr3rDXH9Nvbqk9SJsxTb+hx4rjbq3qyK3vngCfUTTZN6LypmKQce0fZtRM XP7ptMvLQf5Tdu6MaCxX0HfnVQ2w2xEoUMHqiPRSwq3rQcIrcqKFZBleD7+dyCBYDizU AN2vIu/AwFLjZsU3Z38d+jixm2WWwDcU/oOUKD6l0ygjwXQF1j02U2eYWnpDLaMjYbx+ hw1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=3GGFvgjb; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-151758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 v36-20020a05622a18a400b004345fefbd57si4482296qtc.256.2024.04.19.09.42.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 09:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151758-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=@collabora.com header.s=mail header.b=3GGFvgjb; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-151758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 BD1381C21440 for ; Fri, 19 Apr 2024 16:41:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1977131BBC; Fri, 19 Apr 2024 16:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="3GGFvgjb" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 60DED130A5B; Fri, 19 Apr 2024 16:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713544903; cv=none; b=kewFfhgwkhD3NtpintJYe2RD3Q8ETtrAUROV98LQbai/AmuBoPlHJlZJscI7LyhqhBlVK3LUn6DwJ4tLEJ/IL9TxmLHF7spo/Zg33dvZ5mtcwjd9SqTPRZLB1PHYTyRS8hQzZVGB5vE5YtbGM6npi5bRZE9nL5MfLCyP49zVaX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713544903; c=relaxed/simple; bh=5Z86YDj4EGLTHzKnsTgG+U6a/TFj/lqltG1ku3tLxyM=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=E60eZy4xU2x9UWnhwzqidyWIiv+i8VGJ5QJcsZ6fTctnxwhIuJETpbedGBXR6yU1qbN39MfYMFsinv6ig+5PNz6mysZXzPlQHkLlPpQmCauOqSbAQgssdJXWxQUF+C4Hf7v0y713uEZkGDQy9SFywNqu5awYpvBE4X+PLLiO5xI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=3GGFvgjb; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713544900; bh=5Z86YDj4EGLTHzKnsTgG+U6a/TFj/lqltG1ku3tLxyM=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=3GGFvgjbkS2Uhqwpgpau1x6o5G92jZ62keoxo/wkjq4CEvKMAfB37TUzlus/8Jn3D 5PXqXt+uFBud7FcGGVnSSI5ljImlFEVDKCSlub8uj5/5wZFrcD4vTqy5ZlU/HY77ul JdoIv0CtW4hKubI6C/siDWjSt1xJIEybp5yMtHLAPh8ms3AL8xPZyNqZPqNuMGK4KN anOOnGepTkaHTMwEepMHjZz3D/pHkE2z80B3diYFJ7GFgqBkuPG/Z+h0EnYDApDLI3 n3noGohuaq/YHDNRb67uzPgcQQEpFM0/PB+Towyc6mucjgggkL/MNuvB6Kc1hq6T3m 9SdYst0RAtsWg== Received: from [100.113.15.66] (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6500D378214A; Fri, 19 Apr 2024 16:41:32 +0000 (UTC) Message-ID: <58e0539d-423e-42e0-9ee4-8fc8e1eed94f@collabora.com> Date: Fri, 19 Apr 2024 21:41:59 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , Javier Carrasco Subject: Re: [PATCH] selftests: filesystems: fix warn_unused_result build warnings To: Amer Al Shanawany , Shuah Khan , Christian Brauner , Miklos Szeredi , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240417184913.74734-1-amer.shanawany@gmail.com> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <20240417184913.74734-1-amer.shanawany@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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); > } -- BR, Muhammad Usama Anjum