From patchwork Fri Jul 27 13:12:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 143046 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp803785ljj; Fri, 27 Jul 2018 06:12:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBAKEMuiP2tVON8p3EfuQ1Nhj0qk/oCkTn2/VpY44jat5wXOmHKC0Jr/UByYBcQzB00LB3 X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr5804217ple.285.1532697156280; Fri, 27 Jul 2018 06:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532697156; cv=none; d=google.com; s=arc-20160816; b=LY3r5jgwECK1AJ6gzRSgzYEv5OeZRDrHQS0Ez9el/JYT03smy8MeoI7sgm5QoyfKLs cJKqlldMkyqpYqImh44KWn4OmGUzja6TLxl/mI+SiRoS9jTBvDxfDpwJAlTjnpv+vNx/ llOAkSZJ0okb6VeZgJPDrfXE8HG3wXIMC0yvlSIoCM9DTKRwazFWnHn6fAXSN3Cv7smF adRbku8U91QW6XC8ep11NNA48hh8EaxG4dzxAtPc5lvwKdpEgZmN9Ypc/PtxUSAhSyIH PYo3jc7BUIXUNPzzN63Oz23/OaT90cg/DwO6M+LURONlErxtGSXnja9uc1GQ07q9j3l9 epMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=oYsfbDe8EbreNBgpj9GD5F1brqpzdXeODy55iQrc6RI=; b=Qslb+O6IZkzESuH/i9RC8p2vMeN4JTP0x21iLoKYrPEqg9jG8jR0mla1U7v1qajcl5 Iy+5hZR0jSFuifrMfA0TtJvTZ+iBhwWDEQWqQ0TxKprx0U4bU4lo0tzaypNNLmUHk/XT JGrBdH18MrVvhFTqIdoDQ2NfDWoNSEd3lMqk2m/Zshf/Db//gD999J0Ky6FeI4bkrn6s 6p0HGd6++ZLTCFSlfHbVtx15v9XSLKHbVKqQdQphGsp/bHYaV60a4nJgnSSenAEKlMKf lKuDrS5pZ/vDDbzwLmec0oe0VhL5qAUZYc1iP076Xhq4VkXynlF98X485vOgfwb48DXS tJzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="tgR/ZOjN"; dkim=pass header.i=@linaro.org header.s=google header.b=ZoEt5sO7; spf=pass (google.com: domain of libc-alpha-return-94832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94832-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 83-v6si4021927pgg.663.2018.07.27.06.12.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 06:12:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-94832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="tgR/ZOjN"; dkim=pass header.i=@linaro.org header.s=google header.b=ZoEt5sO7; spf=pass (google.com: domain of libc-alpha-return-94832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94832-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=plzEMMDgcAF48AHGSI3JMXklNcE4pqpUjbPcmLnmlEOAOjDDD0e6N DSPfNYTBNw1JLfBz63gV8mGjp15CTEjrodCMhrTmIh6u0OpSAQLIU5SyMob0OYS4 fxsZpO4PB8SAsDHx33XjStbAMoDnA4RIT7LGO5MUihDSgiUnLbSn34= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=y/77eWEnP4m5xc4cdqe0uDdtgvA=; b=tgR/ZOjNO1Y+FenvOiBIV5dELjUo LE/P86SzBld5wDF/wCIYfB2HdMqyUtj9bOlh1rXhwq/uFyNYt/ZbTtWslG3qYguz qL07cK43+ZnTd9iLNMDDIzPlpBV5wui0HghnTHaMxlkpM4hVIqFv9UXp1HtBftpT BDx5KeQaNEYvhyQ= Received: (qmail 105924 invoked by alias); 27 Jul 2018 13:12:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 105893 invoked by uid 89); 27 Jul 2018 13:12:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=oYsfbDe8EbreNBgpj9GD5F1brqpzdXeODy55iQrc6RI=; b=ZoEt5sO7cINmeg0inmgFNbCKkoJeTfHVLiNxFER4CmvNgbWg1/AC93juukwvR6Gie/ drXZm+Mfue0IILKihxkgLdMWRRdocZB+mk8zQhxi5EiXgjJaPRwX97W6MeRFSMQYtCm3 3hZDBtFaTkR/MJBM6T/xqAnjCuOFb7tM2kC7E= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] Fix Linux fcntl OFD locks on unsupported kernels Date: Fri, 27 Jul 2018 10:12:18 -0300 Message-Id: <1532697138-8891-1-git-send-email-adhemerval.zanella@linaro.org> This patch make the OFD tests return unsupported if kernel does not support OFD locks (it was added on 3.15). Checked on a ia64-linux-gnu with Linux 3.14. * sysdeps/unix/sysv/linux/tst-ofdlocks.c: Return unsupported if kernel does not support OFD locks. * sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c | 7 ++++++- sysdeps/unix/sysv/linux/tst-ofdlocks.c | 7 ++++++- 3 files changed, 18 insertions(+), 2 deletions(-) -- 2.7.4 Reviewed-by: Carlos O'Donell diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c index 03c4abf..8da5a0b 100644 --- a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c +++ b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c @@ -62,7 +62,12 @@ do_test (void) .l_start = (off64_t)INT32_MAX + 1024, .l_len = 1024, }; - TEST_VERIFY_EXIT (fcntl (temp_fd, F_OFD_SETLKW, &lck64) == 0); + int ret = fcntl (temp_fd, F_OFD_SETLKW, &lck64); + if (ret == -1 && errno == EINVAL) + /* OFD locks are only available on Linux 3.15. */ + FAIL_UNSUPPORTED ("fcntl (F_OFD_SETLKW) not supported)"); + + TEST_VERIFY_EXIT (ret == 0); /* Open file description locks placed through the same open file description (either by same file descriptor or a duplicated one created by fork, diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks.c b/sysdeps/unix/sysv/linux/tst-ofdlocks.c index bd345e9..66c7856 100644 --- a/sysdeps/unix/sysv/linux/tst-ofdlocks.c +++ b/sysdeps/unix/sysv/linux/tst-ofdlocks.c @@ -46,7 +46,12 @@ do_test (void) .l_start = (off64_t)INT32_MAX + 1024, .l_len = 1024, }; - TEST_VERIFY_EXIT (fcntl64 (temp_fd, F_OFD_SETLKW, &lck64) == 0); + int ret = fcntl64 (temp_fd, F_OFD_SETLKW, &lck64); + if (ret == -1 && errno == EINVAL) + /* OFD locks are only available on Linux 3.15. */ + FAIL_UNSUPPORTED ("fcntl (F_OFD_SETLKW) not supported)"); + + TEST_VERIFY_EXIT (ret == 0); /* Open file description locks placed through the same open file description (either by same file descriptor or a duplicated one created by fork,