public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp-list@lists.sourceforge.net
Cc: liwan@redhat.com, Li Wang <wangli.ahau@gmail.com>
Subject: [LTP] [PATCH] hugemmap/hugemmap03.c: fix the ppc64 FAILED situation procedure
Date: Wed, 28 May 2014 09:32:09 +0800	[thread overview]
Message-ID: <1401240729-15260-1-git-send-email-liwang@redhat.com> (raw)

From: Li Wang <wangli.ahau@gmail.com>

	When testing on ppc64 arch, `./hugemmap03 -s 64` failed message as:
	  hugemmap03    1  TFAIL  :  mmap into high region failed unexpectedly - expect errno=ENOMEM, got: errno=EINVAL(22): Invalid

	But it is not the system issue,  MMAP(2) Programmer's Manual define the mmap() error return value like:
	  EINVAL We don't like addr, length, or offset (e.g., they are too large, or not aligned on a page boundary).
	  ENOMEM No memory is available, or the process's maximum number of mappings would have been exceeded.
	So, we should consider the EINVAL return situation on ppc64.

Signed-off-by: Li Wang <wangli.ahau@gmail.com>
---
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
index 0287ec9..3c1ccdd 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
@@ -100,7 +100,7 @@ int main(int ac, char **av)
 
 		tst_count = 0;
 
-		/* Attempt to mmap into highmem addr, should get ENOMEM */
+		/* Attempt to mmap into highmem addr, should get ENOMEM or EINVAL (on arch ppc64) */
 		addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
 			    MAP_SHARED | MAP_FIXED, fildes, 0);
 		if (addr != MAP_FAILED) {
@@ -108,13 +108,13 @@ int main(int ac, char **av)
 				 "succeeded unexpectedly");
 			goto fail;
 		}
-		if (errno != ENOMEM)
-			tst_resm(TFAIL | TERRNO, "mmap into high region "
-				 "failed unexpectedly - expect "
-				 "errno=ENOMEM, got");
-		else
+		if (errno == ENOMEM || errno == EINVAL)
 			tst_resm(TPASS | TERRNO, "mmap into high region "
 				 "failed as expected");
+		else
+			tst_resm(TFAIL | TERRNO, "mmap into high region "
+				 "failed unexpectedly - expect "
+				 "errno=ENOMEM or EINVAL, got");
 fail:
 		close(fildes);
 	}
-- 
1.8.1.2


------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2014-05-28  1:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28  1:32 Li Wang [this message]
2014-06-05 13:36 ` [LTP] [PATCH] hugemmap/hugemmap03.c: fix the ppc64 FAILED situation procedure chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401240729-15260-1-git-send-email-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=liwan@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangli.ahau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox