From patchwork Thu Aug 4 06:18:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang Xu (Fujitsu)" X-Patchwork-Id: 12936097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57D4AC00144 for ; Thu, 4 Aug 2022 05:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbiHDFSX (ORCPT ); Thu, 4 Aug 2022 01:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbiHDFSX (ORCPT ); Thu, 4 Aug 2022 01:18:23 -0400 Received: from mail1.bemta34.messagelabs.com (mail1.bemta34.messagelabs.com [195.245.231.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEC42229B for ; Wed, 3 Aug 2022 22:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1659590295; i=@fujitsu.com; bh=smDnGogQPyx6jg8pHQLP5FA+2kDlGJgu6asaFgaq3ec=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ejVicccLTMAoAjt+LitSdxiqr3thZZL0cxr042WmsdYGkaHxmZP7nLNAaUjjhw/Wa B0rkofFsnybjbYRmYQXlFK261MRKSArnPxaueF8/E8/3WAlwuxjM3QInbU6PsmQ1Dp 8jT5S5oG7cGOOg5NaniK4DUxH7Aw9kKts3Dp6ZHhkPsjinoG+VuSFy6+gU74vPnmAL B/Bx4D1yUTMPCUg02Yjt4qdX92xCCzEZmqbMOO2cezo1KnuX9yiCsUs4ugHaErsNEW YNM2LrLmg4PAIr1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o qMVcVJwIABjV2W1RAwAA X-Env-Sender: xuyang2018.jy@fujitsu.com X-Msg-Ref: server-2.tower-571.messagelabs.com!1659590295!74686!1 X-Originating-IP: [62.60.8.179] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.87.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28416 invoked from network); 4 Aug 2022 05:18:15 -0000 Received: from unknown (HELO n03ukasimr04.n03.fujitsu.local) (62.60.8.179) by server-2.tower-571.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Aug 2022 05:18:15 -0000 Received: from n03ukasimr04.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTP id 033A57B for ; Thu, 4 Aug 2022 06:18:15 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (R01UKEXCASM126 [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTPS id EB34675 for ; Thu, 4 Aug 2022 06:18:14 +0100 (BST) Received: from localhost.localdomain (10.167.220.84) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 4 Aug 2022 06:18:13 +0100 From: Yang Xu To: CC: Yang Xu Subject: [PATCH] src/t_ofd_locks.c: Reset errno to zero Date: Thu, 4 Aug 2022 14:18:52 +0800 Message-ID: <1659593932-4158-1-git-send-email-xuyang2018.jy@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD08.g08.fujitsu.local (10.167.33.83) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org It seems I met libcap errno bug again when using libcap-2.48-4.el8.x86_64. But this time, errno is EINVAL if c program link with lcap. Lastest upstream libcap doesn't have bug and it should be backport bug. generic/478 will become not run because of this. To fix this that only exists on some distributions, reset errno to zero. Signed-off-by: Yang Xu Reviewed-by: Darrick J. Wong --- src/t_ofd_locks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/t_ofd_locks.c b/src/t_ofd_locks.c index e3b15ddc..e77f2659 100644 --- a/src/t_ofd_locks.c +++ b/src/t_ofd_locks.c @@ -187,6 +187,8 @@ int main(int argc, char **argv) struct sembuf sop; int opt, ret, retry; + //avoid libcap errno bug + errno = 0; while((opt = getopt(argc, argv, "sgrwo:l:PRWtFd")) != -1) { switch(opt) { case 's':