All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul Jackson <pj@sgi.com>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	ak@suse.de
Subject: Re: [PATCH] fix sys cpumap for > 352 NR_CPUS
Date: Fri, 4 Jun 2004 11:15:28 -0700	[thread overview]
Message-ID: <20040604181528.GA11527@kroah.com> (raw)
In-Reply-To: <1086312466.7990.884.camel@bach>

On Fri, Jun 04, 2004 at 11:27:46AM +1000, Rusty Russell wrote:
> On Fri, 2004-06-04 at 02:51, Greg KH wrote:
> > Just be aware of the size and code your show() function to be defensive
> > and not overrun that size.
> 
> This is where we have a philosophical difference.  As I understand it,
> the rule is, "don't put big things in attributes".  If we want to change
> that rule, we need to do more work, like pass the length to the show
> function, and handle -ENOMEM by reallocating and looping.

We don't want to change the rule, it's a good rule.

> But I think the /rule/ is a good one: if you need to handle something
> arbitrarily large, DON'T USE THIS INTERFACE, because there is no way to
> do that correctly.  This allows us to handle 99.9% of cases as a
> one-liner, which I think has great merit.

Agreed.

> I think we should guarantee any kernel primitive fits into the space:
> this means it should comfortably fit printing a cpumask_t.  I would
> argue for a #error inside the cpumask or sysfs code which ensures we can
> fit two cpumasks (~7000 CPUs on page-size 4096), so we explode early if
> this ever becomes a problem, and a runtime sanity check inside the sysfs
> code to BUG on overrun.

Again, this seems to be a issue with the code that is trying to export a
cpumask_t.  I suggest you keep the check inside that code and keep it
out of the sysfs core, which does not need it for 99.99% of the cases.

thanks,

greg k-h

      reply	other threads:[~2004-06-04 18:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 23:11 [PATCH] fix sys cpumap for > 352 NR_CPUS 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
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 [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=20040604181528.GA11527@kroah.com \
    --to=greg@kroah.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.