From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: miaox@cn.fujitsu.com, Linux-Kernel <linux-kernel@vger.kernel.org>,
Paul Jackson <pj@sgi.com>, Paul Menage <menage@google.com>
Subject: Re: [PATCH 1/2] cpusets: restructure the function update_cpumask() and update_nodemask()
Date: Wed, 02 Jul 2008 17:54:59 +0800 [thread overview]
Message-ID: <486B5073.9030207@cn.fujitsu.com> (raw)
In-Reply-To: <486B4D52.80402@cn.fujitsu.com>
>> kernel/cpuset.c: In function 'cpuset_write_resmask':
>> kernel/cpuset.c:1374: warning: passing argument 2 of 'update_nodemask' discards qualifiers from pointer target type
>>
>> Did you not get this warning also?
>>
>> I don't know how to fix it. cftype.write_string() requires a const
>> char* in the third arg, but we then go on to call update_nodemask(),
>> which does a strstrip() on this allegedly-const char array.
>>
>
> That strstrip() should be removed. because cgroup_write_string() already strstrip()ed
> the buffer. Paul M's original patch removed that 2 strstrip()s in cpuset.c.
>
Here is the patch:
--- linux-2.6.26-rc7/kernel/cpuset.c.bak 2008-07-02 17:53:07.000000000 +0800
+++ linux-2.6.26-rc7/kernel/cpuset.c 2008-07-02 17:53:23.000000000 +0800
@@ -1011,7 +1011,7 @@ done:
* lock each such tasks mm->mmap_sem, scan its vma's and rebind
* their mempolicies to the cpusets new mems_allowed.
*/
-static int update_nodemask(struct cpuset *cs, char *buf)
+static int update_nodemask(struct cpuset *cs, const char *buf)
{
struct cpuset trialcs;
nodemask_t oldmem;
@@ -1032,7 +1032,6 @@ static int update_nodemask(struct cpuset
* that parsing. The validate_change() call ensures that cpusets
* with tasks have memory.
*/
- buf = strstrip(buf);
if (!*buf) {
nodes_clear(trialcs.mems_allowed);
} else {
>> Taking a copy of the string in update_nodemask() would fix things, but
>> that's pretty lame.
>>
next prev parent reply other threads:[~2008-07-02 9:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 8:31 [PATCH 1/2] cpusets: restructure the function update_cpumask() and update_nodemask() Miao Xie
2008-06-02 9:55 ` Paul Jackson
2008-06-03 22:03 ` Andrew Morton
2008-06-04 0:55 ` Li Zefan
2008-06-04 2:00 ` Miao Xie
2008-06-04 2:11 ` Andrew Morton
2008-06-04 2:16 ` Li Zefan
2008-06-04 2:59 ` Paul Jackson
2008-06-04 4:00 ` Andrew Morton
2008-06-04 4:02 ` Andrew Morton
2008-06-04 4:07 ` Paul Jackson
2008-07-02 9:19 ` Andrew Morton
2008-07-02 9:41 ` Li Zefan
2008-07-02 9:54 ` Li Zefan [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-06-04 2:03 Miao Xie
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=486B5073.9030207@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=miaox@cn.fujitsu.com \
--cc=pj@sgi.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