From patchwork Fri Jan 11 13:20:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1023573 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43bk8G5BrPz9s7h for ; Sat, 12 Jan 2019 00:23:26 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C3F6A3EA9B2 for ; Fri, 11 Jan 2019 14:23:22 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id E02753EA20C for ; Fri, 11 Jan 2019 14:23:20 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 68A66100094C for ; Fri, 11 Jan 2019 14:23:18 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9A232ACFA; Fri, 11 Jan 2019 13:23:18 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Fri, 11 Jan 2019 14:20:49 +0100 Message-Id: <20190111132049.32121-1-chrubis@suse.cz> X-Mailer: git-send-email 2.18.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH] [COMMITTED] syscalls/fadvise: Fix regression X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" These test were disabled from execution without _FILE_OFFSET_BITS != 64 since their conversion into the new library. The problem is that we didn't copied the original condition correctly. Originally the tests were disabled in case of: if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) While after the change they were disabled in case of: Now looking at the original condition the __NR_fadvise64 was never equal to 0, since the original tests included lapi/syscalls.h which defines fallback definitions with value -1. So either had the __NR_fadvise64 correct value or was set to -1. All in all looking at the code it does not make sense to disable these tests anyway, so this commit just removes the ifdefs. Signed-off-by: Cyril Hrubis CC: Amir Goldstein --- testcases/kernel/syscalls/fadvise/posix_fadvise01.c | 11 ----------- testcases/kernel/syscalls/fadvise/posix_fadvise02.c | 11 ----------- testcases/kernel/syscalls/fadvise/posix_fadvise03.c | 11 ----------- testcases/kernel/syscalls/fadvise/posix_fadvise04.c | 10 ---------- 4 files changed, 43 deletions(-) diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c index e52692c06..2af040840 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c @@ -29,13 +29,7 @@ #include #include "tst_test.h" - #include "lapi/syscalls.h" -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 32 -#endif - -#if (_FILE_OFFSET_BITS == 64) char fname[] = "/bin/cat"; /* test executable to open */ int fd = -1; /* initialized in open */ @@ -86,8 +80,3 @@ static struct tst_test test = { .test = verify_fadvise, .tcnt = ARRAY_SIZE(defined_advise), }; - -#else - TST_TEST_TCONF("This test can only run on kernels that implements " - "fadvise64 which is used from posix_fadvise"); -#endif diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c index 8598b9666..d533a7953 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c @@ -28,13 +28,7 @@ #include #include "tst_test.h" - #include "lapi/syscalls.h" -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 32 -#endif - -#if (_FILE_OFFSET_BITS == 64) #define WRONG_FD 42 /* The number has no meaning. Just used as something wrong fd */ @@ -93,8 +87,3 @@ static struct tst_test test = { .test = verify_fadvise, .tcnt = ARRAY_SIZE(defined_advise), }; - -#else - TST_TEST_TCONF("This test can only run on kernels that implements " - "fadvise64 which is used from posix_fadvise"); -#endif diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c index 8cc90c431..0127a1b04 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c @@ -29,13 +29,7 @@ #include #include "tst_test.h" - #include "lapi/syscalls.h" -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 32 -#endif - -#if (_FILE_OFFSET_BITS == 64) char fname[] = "/bin/cat"; /* test executable to open */ int fd = -1; /* initialized in open */ @@ -135,8 +129,3 @@ static struct tst_test test = { .test = verify_fadvise, .tcnt = ADVISE_LIMIT, }; - -#else - TST_TEST_TCONF("This test can only run on kernels that implements " - "fadvise64 which is used from posix_fadvise"); -#endif diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c index 6cee03bf9..d8d8fb601 100644 --- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c +++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c @@ -30,11 +30,6 @@ #include "tst_test.h" #include "lapi/syscalls.h" -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 32 -#endif - -#if (_FILE_OFFSET_BITS == 64) static int pipedes[2]; @@ -91,8 +86,3 @@ static struct tst_test test = { .tcnt = ARRAY_SIZE(defined_advise), .min_kver = "2.6.16", }; - -#else - TST_TEST_TCONF("This test can only run on kernels that implements " - "fadvise64 which is used from posix_fadvise"); -#endif