From patchwork Mon May 14 09:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 912794 X-Patchwork-Delegate: petr.vorel@gmail.com 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=213.254.12.146; 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 [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40kwMK3xRRz9ryk for ; Mon, 14 May 2018 19:27:09 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id F3B9D3E75D0 for ; Mon, 14 May 2018 11:27:05 +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 [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id B9C953E602C for ; Mon, 14 May 2018 11:27:04 +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 5E4D8601623 for ; Mon, 14 May 2018 11:26:43 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24EBE818A6A8 for ; Mon, 14 May 2018 09:26:42 +0000 (UTC) Received: from dhcp-12-102.nay.redhat.com (unknown [10.66.12.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 412091102E30 for ; Mon, 14 May 2018 09:26:40 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 14 May 2018 17:26:35 +0800 Message-Id: <20180514092635.26100-2-liwang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 14 May 2018 09:26:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 14 May 2018 09:26:42 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 2/2] madvise: add ERRORS check for MADV_REMOVE/MADV_FREE/MADV_WIPEONFORK 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" Signed-off-by: Li Wang --- testcases/kernel/syscalls/madvise/madvise02.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c index b773efd..af52741 100644 --- a/testcases/kernel/syscalls/madvise/madvise02.c +++ b/testcases/kernel/syscalls/madvise/madvise02.c @@ -72,12 +72,15 @@ static struct tcase { } tcases[] = { {MADV_NORMAL, "MADV_NORMAL", &nonalign, EINVAL, 0}, {1212, "MADV_NORMAL", &file1, EINVAL, 0}, + {MADV_REMOVE, "MADV_REMOVE", &file1, EINVAL, 0}, {MADV_DONTNEED, "MADV_DONTNEED", &file1, EINVAL, 1}, {MADV_MERGEABLE, "MADV_MERGEABLE", &file1, EINVAL, 0}, {MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1, EINVAL, 0}, {MADV_NORMAL, "MADV_NORMAL", &file2, ENOMEM, 0}, {MADV_WILLNEED, "MADV_WILLNEED", &file2, ENOMEM, 0}, {MADV_WILLNEED, "MADV_WILLNEED", &tmp_addr, EBADF, 0}, + {MADV_FREE, "MADV_FREE", &file1, EINVAL, 0}, + {MADV_WIPEONFORK, "MADV_WIPEONFORK", &file1, EINVAL, 0}, }; static void tcases_filter(void) @@ -95,7 +98,10 @@ static void tcases_filter(void) tc->skip = 0; #endif /* if !defined(UCLINUX) */ break; - + case MADV_REMOVE: + if ((tst_kvercmp(2, 6, 16)) < 0) + tc->skip = 1; + break; case MADV_MERGEABLE: case MADV_UNMERGEABLE: if ((tst_kvercmp(2, 6, 32)) < 0) @@ -114,6 +120,14 @@ static void tcases_filter(void) tc->exp_errno == EBADF) tc->skip = 1; break; + case MADV_FREE: + if ((tst_kvercmp(4, 5, 0)) < 0) + tc->skip = 1; + break; + case MADV_WIPEONFORK: + if ((tst_kvercmp(4, 14, 0)) < 0) + tc->skip = 1; + break; default: break; }