From patchwork Mon Jul 23 05:40:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 947612 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=fail (p=none dis=none) header.from=redhat.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Yr1G3G54z9s2g for ; Mon, 23 Jul 2018 15:40:13 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D585C3E6FF5 for ; Mon, 23 Jul 2018 07:40:09 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 9F7FA3E6FC8 for ; Mon, 23 Jul 2018 07:40:07 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 843C4600A0C for ; Mon, 23 Jul 2018 07:40:06 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E6C640241CA for ; Mon, 23 Jul 2018 05:40:04 +0000 (UTC) Received: from dhcp-12-102.nay.redhat.com (unknown [10.66.12.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 599FE2156897; Mon, 23 Jul 2018 05:40:02 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 23 Jul 2018 13:40:00 +0800 Message-Id: <20180723054000.13760-1-liwang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 23 Jul 2018 05:40:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 23 Jul 2018 05:40:04 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'liwang@redhat.com' RCPT:'' X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] madvise: remove the min_kver check 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" For the reason that most of LTS enterprise linux distribution backport this MADV_WIPEONFORK feature, here let's cancel the kernel limitation to make madvise(..., MADV_WIPEONFORK) test more widely. Signed-off-by: Li Wang --- testcases/kernel/syscalls/madvise/madvise10.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/madvise/madvise10.c b/testcases/kernel/syscalls/madvise/madvise10.c index f040c2d..9cb3d2b 100644 --- a/testcases/kernel/syscalls/madvise/madvise10.c +++ b/testcases/kernel/syscalls/madvise/madvise10.c @@ -103,8 +103,13 @@ static int set_advice(char *addr, int size, int advise) TEST(madvise(addr, size, advise)); if (TEST_RETURN == -1) { - tst_res(TFAIL | TTERRNO, "madvise(%p, %d, 0x%x)", + if (TEST_ERRNO == EINVAL) { + tst_res(TCONF, "madvise(%p, %d, 0x%x) is not supported", addr, size, advise); + } else { + tst_res(TFAIL | TTERRNO, "madvise(%p, %d, 0x%x)", + addr, size, advise); + } return 1; } @@ -175,5 +180,4 @@ static struct tst_test test = { .forks_child = 1, .test = test_madvise, .setup = setup, - .min_kver = "4.14", };