public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP]  [PATCH 2/2] mbind01: Fix the bug of mind case06
Date: Wed, 02 Sep 2009 13:44:53 +0800	[thread overview]
Message-ID: <4A9E0655.4030703@cn.fujitsu.com> (raw)

I tested ltp mbind case and found the case06 failed.

In mbind manual, it says "If the nodemask and maxnode arguments specify the empty set, 
then the memory is allocated on the node of the CPU that triggered the allocation."

In case06, when tc->policy is MPOL_PREFERRED and tc->from_node is NONE, the getnodemask 
which is get by get_mempolicy() refer to the node of the CPU that triggered the allocation.
But the nodemask is zero.(It is not used by mbind(), mbind() used "NULL".)

So in this case, the cmp_ok should only compare the policy.

Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
 testcases/kernel/syscalls/mbind/mbind01.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 94c2dd0..446fdaf 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -305,7 +305,10 @@ static int do_test(struct test_case *tc) {
 // When policy equals MPOL_DEFAULT, then get_mempolicy not return node
         if (tc->policy == MPOL_DEFAULT)
 		nodemask_zero(&nodemask);
-	cmp_ok = ((tc->policy == policy) && nodemask_equal(&nodemask,&getnodemask));
+	if ((tc->policy == MPOL_PREFERRED) && (tc->from_node == NONE))
+		cmp_ok = (tc->policy == policy);
+	else
+		cmp_ok = ((tc->policy == policy) && nodemask_equal(&nodemask,&getnodemask));
         if (opt_debug) {
 		nodemask_dump("nodemask Expect:", &nodemask);
 		nodemask_dump("nodemask Result:", &getnodemask);



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2009-09-02  5:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02  5:44 Zhang Xiliang [this message]
2009-09-07 11:41 ` [LTP] [PATCH 2/2] mbind01: Fix the bug of mind case06 Subrata Modak

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=4A9E0655.4030703@cn.fujitsu.com \
    --to=zhangxiliang@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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