From: Caspar Zhang <caspar@casparzhang.com>
To: Zhouping Liu <zliu@redhat.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 3/2] mm: fix possible node missing in write_cpusets
Date: Tue, 21 Feb 2012 10:44:14 +0800 [thread overview]
Message-ID: <4F4304FE.50606@casparzhang.com> (raw)
In-Reply-To: <bb215812-518c-4d08-971d-7ed628347f4b@zmail13.collab.prod.int.phx2.redhat.com>
On 02/20/2012 09:49 PM, Zhouping Liu wrote:
> hi, caspar
>>
>>
>> If a system has noncontinuous nodes, or the node doesn't start from
>> 0,
>> write_cpusets() function may fail because it hard-coded second node
>> as
>> "node1". This patch fixes the function by fetching second node number
>> from the stored array.
>>
>> Tested-by: Caspar Zhang <caspar@casparzhang.com>
>> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
>> ---
>> testcases/kernel/mem/include/mem.h | 4 ++--
>> testcases/kernel/mem/ksm/ksm02.c | 6 ++----
>> testcases/kernel/mem/ksm/ksm04.c | 6 ++----
>> testcases/kernel/mem/lib/mem.c | 21 +++++++++++++--------
>> 4 files changed, 19 insertions(+), 18 deletions(-)
>>
>>
> inside write_cpusets(),
>> fd = open(CPATH_NEW "/mems", O_WRONLY);
>> if (fd == -1) {
>> if (errno == ENOENT) {
>> fd = open(CPATH_NEW "/cpuset.mems", O_WRONLY);
>> if (fd == -1)
>> tst_brkm(TBROK|TERRNO, cleanup, "open %s", buf);
>> } else
>> tst_brkm(TBROK|TERRNO, cleanup, "open %s", buf);
>> }
>> if (write(fd, "1", 1) != 1)
> you maybe missed here, it should be:
>
> snprintf(buf, BUFSIZ, "%ld", nd);
> if (wirte(fd, buf, strlen(buf)) !=strlen(buf))
you're right.
Thanks,
Caspar
>
>> tst_brkm(TBROK|TERRNO, cleanup, "write %s", buf);
>> close(fd);
>
> others is okay for me.
>
> thanks,
> Zhouping
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next parent reply other threads:[~2012-02-21 2:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bb215812-518c-4d08-971d-7ed628347f4b@zmail13.collab.prod.int.phx2.redhat.com>
2012-02-21 2:44 ` Caspar Zhang [this message]
2012-02-20 10:55 [LTP] [PATCH 1/2] mm/lib: change count_numa() behavior Caspar Zhang
2012-02-20 12:21 ` [LTP] [PATCH 3/2] mm: fix possible node missing in write_cpusets Caspar Zhang
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=4F4304FE.50606@casparzhang.com \
--to=caspar@casparzhang.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=zliu@redhat.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