public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] mbind01: Fix the bug of mind case10
Date: Mon, 07 Sep 2009 17:11:20 +0530	[thread overview]
Message-ID: <1252323696.4922.31.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <4A9E236B.6040606@cn.fujitsu.com>

On Wed, 2009-09-02 at 15:48 +0800, Zhang Xiliang wrote: 
> I tested ltp mbind01 case and found the case10 failed.
> 
> In case10, the expect errno is EFAULT. 
> 
> In mbind manual, it says "EFAULT Part or all of the memory range specified by nodemask 
> and maxnode points outside your accessible address space. "
> 
> So the case should use invalid "nodemask" instead of invalid "p" to test.
> 
> Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>

Thanks.

Regards--
Subrata

> ---
>  testcases/kernel/syscalls/mbind/mbind01.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
> index 446fdaf..4afa71b 100644
> --- a/testcases/kernel/syscalls/mbind/mbind01.c
> +++ b/testcases/kernel/syscalls/mbind/mbind01.c
> @@ -238,8 +238,8 @@ static struct test_case tcase[] = {
>          },
>          { // case10
>                  .ttype          = INVALID_POINTER,
> -                .policy         = MPOL_DEFAULT,
> -                .from_node      = NONE,
> +                .policy         = MPOL_PREFERRED,
> +                .from_node      = SELF,
>                  .ret            = -1,
>                  .err            = EFAULT,
>          },
> @@ -263,6 +263,7 @@ static int do_test(struct test_case *tc) {
>          nodemask_t nodemask, getnodemask;
>          unsigned long maxnode = NUMA_NUM_NODES;
>          unsigned long len = MEM_LENGTH;
> +	unsigned long *invalid_nodemask;
> 
>          /* We assume that there is only one node(node0). */
>          nodemask_zero(&nodemask);
> @@ -279,13 +280,15 @@ static int do_test(struct test_case *tc) {
>                  tst_exit();
>          }
>          if(tc->ttype == INVALID_POINTER)
> -                p = (char*)0xc0000000;
> +		invalid_nodemask = (unsigned long *)0xc0000000;
>  /*
>           * Execute system call
>           */
>          errno = 0;
>          if (tc->from_node == NONE)
>                  TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy,NULL, 0, tc->flags));
> +	else if (tc->ttype == INVALID_POINTER)
> +		TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy, invalid_nodemask, maxnode, tc->flags));
>          else
>                  TEST(sys_ret = syscall(__NR_mbind, p, len, tc->policy,&nodemask, maxnode, tc->flags));
>          sys_errno = errno;
> 
> 
> ------------------------------------------------------------------------------
> 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


------------------------------------------------------------------------------
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-07 11:42 UTC|newest]

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

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=1252323696.4922.31.camel@subratamodak.linux.ibm.com \
    --to=subrata@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=zhangxiliang@cn.fujitsu.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