From: Andrew Morton <akpm@osdl.org>
To: Paul Jackson <pj@sgi.com>
Cc: linux-kernel@vger.kernel.org, ak@suse.de,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] fix sys cpumap for > 352 NR_CPUS
Date: Wed, 2 Jun 2004 16:23:30 -0700 [thread overview]
Message-ID: <20040602162330.0664ec5d.akpm@osdl.org> (raw)
In-Reply-To: <20040602161115.1340f698.pj@sgi.com>
Paul Jackson <pj@sgi.com> wrote:
>
> @@ -21,9 +21,21 @@ static ssize_t node_read_cpumap(struct s
> cpumask_t mask = node_dev->cpumap;
> int len;
>
> - /* FIXME - someone should pass us a buffer size (count) or
> - * use seq_file or something to avoid buffer overrun risk. */
> - len = cpumask_scnprintf(buf, 99 /* XXX FIXME */, mask);
> + /*
> + * Hack alert:
> + * 1) This could overwrite a buffer w/o warning. Someone should
> + * pass us a buffer size (count) or use seq_file or something
> + * to avoid buffer overrun risks.
> + * 2) This can return a count larger than the read size requested
> + * by the user code - possibly confusing it.
> + * 3) Following hardcodes that mask scnprintf format requires 9
> + * chars of output for each 32 bits of mask or fraction.
> + * 4) Following prints stale node_dev->cpumap value, instead of
> + * evaluating afresh node_to_cpumask(node_dev->sysdev.id).
> + * 5) Why does struct node even has the field cpumap. Won't it
> + * just get stale, especially in the face of cpu hotplug?
> + */
> + len = cpumask_scnprintf(buf, ((NR_CPUS+31)/32)*9 /* XXX FIXME */, mask);
Oh dear. The sysfs failure to pass in a `length' arg bites again. Can't
we just stick a PAGE_SIZE in here?
wrt the hotplug questions: dunno. Rusty is ->thattaway.
next prev parent reply other threads:[~2004-06-02 23:21 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 [this message]
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
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=20040602162330.0664ec5d.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
--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®