From patchwork Tue Oct 18 10:57:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 77982 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp820892qge; Tue, 18 Oct 2016 03:57:59 -0700 (PDT) X-Received: by 10.98.139.193 with SMTP id e62mr3911631pfl.84.1476788279446; Tue, 18 Oct 2016 03:57:59 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id j9si29373845pao.105.2016.10.18.03.57.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2016 03:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-73938-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; spf=pass (google.com: domain of libc-alpha-return-73938-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-73938-patch=linaro.org@sourceware.org; dmarc=fail (p=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=KoP2ElpS2C7mGJzKRXAX4UfFYU/PqXOKfYHHm0JdWpDOl7nXvRr9O ZNdUKNwHRs7WJoP1onO+O1SwIZVDeuMCpfseHRJV8nbMOwqVOjnOJVphA3bqEbOJ duzQm7ITJvOIirVyIqIHXBxGaWClBHoXD4kWJ6kJw5SbJ34CnhTdtw= 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=cTx7WEl7JPIu0FQ8qDe5VsnP+Oc=; b=R+leyPzyKRSWv9yvZLcgB31wifZb Tto1stRVwj4bK3pivlhMw/YJjNQ14m5URTby5hv6Cp108erPePNKmc2UAa28gIT3 U5FfuPHJUfnjp5csKN7P0xdE6/lV7uRilG2ovE8+ukXE5KqZxzKvCok0vKz0CWl5 fVbbJ4nRW/7s0x8= Received: (qmail 32714 invoked by alias); 18 Oct 2016 10:57:50 -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 32700 invoked by uid 89); 18 Oct 2016 10:57:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-vk0-f44.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=gMOvXdXaZPBChhdH3ZXuSpjWBbkNWi6vzNcSdt42t9k=; b=OtHSvbIoBbZUGYPtK/fT+u5KWCmZYW6Ixw7gmn108JB+CJOddQhsoJ1bWnwBk/Wal9 u8aQk8X+ihPouI/oQV0ykVYqfSaTxkq/A4J0J27RD7VAT844ZJk+8VO3emHHVym05xvC Mok+wR2RUloax0whHJ4n9sYHA2YCWm8TrhVl+oigoBfPrrqzXP8UJXzhotGA7t8nIAyd jeLrDj+y328imBH7KENqoAYq1NCRjyS1A7cTeN+oiIiASGc9nRT6zyYJmr66AUHiZo9c ZLJWYMSRKCMAoWfswXO9+7/S+uvdLfybIEaXadY84NjEpLnNqsnDx9wPSeIAjG4ll2gS 035g== X-Gm-Message-State: AA6/9RknXO0Wg6PHlBFzayreRoH4gP8zntT6TLaWuqUl7BgG+4ztPOoDCBAAlZAS4rdSfq09 X-Received: by 10.31.52.66 with SMTP id b63mr1814975vka.9.1476788257900; Tue, 18 Oct 2016 03:57:37 -0700 (PDT) From: Adhemerval Zanella X-Google-Original-From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] Fix Linux fallocate tests for EOPNOTSUPP Date: Tue, 18 Oct 2016 08:57:28 -0200 Message-Id: <1476788248-21416-1-git-send-email-adhemerval.zanella@linaro.com> The fallocate syscall might fail on Linux due missing support from underlying filesystem (for instance some NFS versions). This patch adds this check for fallocate tests. It also moves tst-fallocate{64} to 'io' folder (since it is on fallocate{64} is built). Checked on x86_64. * sysdeps/unix/sysv/linux/Makefile [$(subdir) = math] (tests): Move tst-fallocate{64}. * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Check for EOPNOTSUPP on syscall return. --- ChangeLog | 7 +++++++ sysdeps/unix/sysv/linux/Makefile | 4 +++- sysdeps/unix/sysv/linux/tst-fallocate-common.c | 8 +++++++- 3 files changed, 17 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 101e120..e329a6b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -43,7 +43,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/mman-linux.h tests += tst-clone tst-clone2 tst-fanotify tst-personality tst-quota \ - tst-fallocate tst-fallocate64 tst-sync_file_range + tst-sync_file_range # Generate the list of SYS_* macros for the system calls (__NR_* macros). @@ -173,6 +173,8 @@ ifeq ($(subdir),io) sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ sync_file_range fallocate fallocate64 sysdep_headers += bits/fcntl-linux.h + +tests += tst-fallocate tst-fallocate64 endif ifeq ($(subdir),elf) diff --git a/sysdeps/unix/sysv/linux/tst-fallocate-common.c b/sysdeps/unix/sysv/linux/tst-fallocate-common.c index 9879488..d98bf4a 100644 --- a/sysdeps/unix/sysv/linux/tst-fallocate-common.c +++ b/sysdeps/unix/sysv/linux/tst-fallocate-common.c @@ -58,7 +58,13 @@ do_test_with_offset (off_t offset) and check if both buffer have the same contents. */ ret = fallocate (temp_fd, 0, offset, BLK_SIZE); if (ret == -1) - FAIL_EXIT1 ("fallocate failed"); + { + /* fallocate might not be fully supported by underlying filesystem (for + instance some NFS versions). */ + if (errno == EOPNOTSUPP) + FAIL_EXIT (77, "fallocate not supported"); + FAIL_EXIT1 ("fallocate failed"); + } ret = fstat (temp_fd, &finfo); if (ret == -1)