From: Paul Jackson <pj@sgi.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, ak@suse.de, greg@kroah.com
Subject: Re: [PATCH] fix sys cpumap for > 352 NR_CPUS
Date: Thu, 3 Jun 2004 08:49:36 -0700 [thread overview]
Message-ID: <20040603084936.532c6c81.pj@sgi.com> (raw)
In-Reply-To: <1086243997.29390.527.camel@bach>
This patch (fix-sys-cpumap-for-352-nr_cpus) doesn't work. Passing -1UL
to cpumask_scnprintf() suppresses all of the requested output, because
of the following code in lib/vsprintf.c vsnprintf():
/* Reject out-of-range values early */
if (unlikely((int) size < 0)) {
/* There can be only one.. */
static int warn = 1;
WARN_ON(warn);
warn = 0;
return 0;
}
Using PAGE_SIZE works ok. Well, lets throw in a -1 to leave a slot for
the newline, while we're here.
Signed-off-by: Paul Jackson <pj@sgi.com>
Index: 2.6.7-rc2-mm2/drivers/base/node.c
===================================================================
--- 2.6.7-rc2-mm2.orig/drivers/base/node.c 2004-06-03 08:24:19.000000000 -0700
+++ 2.6.7-rc2-mm2/drivers/base/node.c 2004-06-03 08:26:12.000000000 -0700
@@ -24,7 +24,7 @@ static ssize_t node_read_cpumap(struct s
/* 2004/06/03: buf currently PAGE_SIZE, need > 1 char per 4 bits. */
BUILD_BUG_ON(NR_CPUS/4 > PAGE_SIZE/2);
- len = cpumask_scnprintf(buf, -1UL, mask);
+ len = cpumask_scnprintf(buf, PAGE_SIZE-1, mask);
len += sprintf(buf + len, "\n");
return len;
}
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
next prev parent reply other threads:[~2004-06-03 15:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 23:11 Paul Jackson
2004-06-02 23:23 ` Andrew Morton
2004-06-02 23:59 ` Paul Jackson
2004-06-03 0:17 ` Andrew Morton
2004-06-03 16:24 ` Greg KH
2004-06-03 16:28 ` Paul Jackson
2004-06-03 0:22 ` Rusty Russell
2004-06-03 4:25 ` Paul Jackson
2004-06-03 6:26 ` Rusty Russell
2004-06-03 8:27 ` Paul Jackson
2004-06-04 1:12 ` Rusty Russell
2004-06-04 2:25 ` Paul Jackson
2004-06-03 15:49 ` Paul Jackson [this message]
2004-06-03 4:34 ` Paul Jackson
2004-06-03 4:35 ` Rusty Russell
2004-06-03 16:27 ` Greg KH
2004-06-03 16:38 ` Paul Jackson
2004-06-03 16:51 ` Greg KH
2004-06-04 1:27 ` Rusty Russell
2004-06-04 18:15 ` Greg KH
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=20040603084936.532c6c81.pj@sgi.com \
--to=pj@sgi.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®