Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4413037pxb; Mon, 21 Feb 2022 20:48:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJztKeQJwZXwDuMD45/OSzJVqFd7LvYvtthj1ANZCWrq3j3sXRE5ZT5aT3YtaYfF+XinhVNK X-Received: by 2002:a17:902:7c01:b0:14f:44f2:4fa with SMTP id x1-20020a1709027c0100b0014f44f204famr21940286pll.36.1645505285699; Mon, 21 Feb 2022 20:48:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645505285; cv=none; d=google.com; s=arc-20160816; b=Es9a7mLc0yldISf7fgbUn46B7JjOPy/GAC+MhfoFC6JKQ7jBWzPKthCeWym1ccuj+U EmcilEBd0KMlaqDy54V4zBIuOYGdwYWeX/7gD0tTga9Laglf/Uh4kg+Jg9CCz1ABm/+6 4P4oLjKMMpjm6HhHe0ppMQprdxzmENDlC58vYl1zdS1B5W3hIaMNPWJM0ca29OCNvPNk BJSYhUDCq77tPb3bVvWtglgTiFy61KAEMMAH+FJtbGiA9+sRCtvMP2+H8mqaNBfyr78R P33PrThWM/IuDZvom7DYDE7lQtMUt8WMOvzZYn/t6J5b23e7Qrk83qTW53ullKiDIKF2 h/TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7Yac87CmUHfCODApgripM6GlABvkUIONDwLm8GRAeko=; b=PAzY/OMhIAyN3PmjsWLRbSdvw9w02isHGbWpOAk51mCgKiHFYF+tyrqw+QYDYpJzfc iHrEcX/v6I3gKkDIUjnaSUBx8jtBXS5GvXBNuT6HpkeF+panA0EIEHcCOJOVkR3z4aCx Qj+jvCwrS/soCihTyWL8DEzE9m0CvM7dnHqbygZtOSWxt0JtR9TdVhpRX/CfHlsWuW8Q TeE60E00Ya+2Yf/P4we194UIt1SadWcdQg7nvVVIEZcGtFTukTOI9g0wN0K3Roe0fPqx OtKEcW6XO3u9Gu6d9ILMezVB5yTNliikUukRqRXzd8wnPx/50B584IHagmUJL0S7sy9h Mu6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iqKw7Hmp; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c12-20020a17090a4d0c00b001bc3ee8ac1esi1084568pjg.128.2022.02.21.20.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:48:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iqKw7Hmp; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 668B215A35; Mon, 21 Feb 2022 20:29:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349788AbiBUJ22 (ORCPT + 99 others); Mon, 21 Feb 2022 04:28:28 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349603AbiBUJVe (ORCPT ); Mon, 21 Feb 2022 04:21:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 477A52459B; Mon, 21 Feb 2022 01:08:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA3E46097C; Mon, 21 Feb 2022 09:08:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA708C340E9; Mon, 21 Feb 2022 09:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434512; bh=Y4lticyda0JJhfUxP3JKpsyz7hPDielaAkyHNjgAZRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iqKw7Hmp5McxSTGsbOqsqtoulxSmlAurPupO5Wt3vs5FAA5zs9JrY88ZAHK88T90V +2vznecNpvVc7N0A3KqJLCvaTl0bRSUKdKHZPTnIR5n9ocDQCrAoXSuIoh6HgwJueV zoo95AW0MsCF48LUG43SnrO89A9xrnAI2S/XaotI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= , Cristian Marussi , Shuah Khan , Sasha Levin Subject: [PATCH 5.15 033/196] selftests: skip mincore.check_file_mmap when fs lacks needed support Date: Mon, 21 Feb 2022 09:47:45 +0100 Message-Id: <20220221084932.046085132@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cristian Marussi [ Upstream commit dae1d8ac31896988e7313384c0370176a75e9b45 ] Report mincore.check_file_mmap as SKIP instead of FAIL if the underlying filesystem lacks support of O_TMPFILE or fallocate since such failures are not really related to mincore functionality. Cc: Ricardo CaƱuelo Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- .../selftests/mincore/mincore_selftest.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/mincore/mincore_selftest.c b/tools/testing/selftests/mincore/mincore_selftest.c index e54106643337b..4c88238fc8f05 100644 --- a/tools/testing/selftests/mincore/mincore_selftest.c +++ b/tools/testing/selftests/mincore/mincore_selftest.c @@ -207,15 +207,21 @@ TEST(check_file_mmap) errno = 0; fd = open(".", O_TMPFILE | O_RDWR, 0600); - ASSERT_NE(-1, fd) { - TH_LOG("Can't create temporary file: %s", - strerror(errno)); + if (fd < 0) { + ASSERT_EQ(errno, EOPNOTSUPP) { + TH_LOG("Can't create temporary file: %s", + strerror(errno)); + } + SKIP(goto out_free, "O_TMPFILE not supported by filesystem."); } errno = 0; retval = fallocate(fd, 0, 0, FILE_SIZE); - ASSERT_EQ(0, retval) { - TH_LOG("Error allocating space for the temporary file: %s", - strerror(errno)); + if (retval) { + ASSERT_EQ(errno, EOPNOTSUPP) { + TH_LOG("Error allocating space for the temporary file: %s", + strerror(errno)); + } + SKIP(goto out_close, "fallocate not supported by filesystem."); } /* @@ -271,7 +277,9 @@ TEST(check_file_mmap) } munmap(addr, FILE_SIZE); +out_close: close(fd); +out_free: free(vec); } -- 2.34.1