On Thu, 2005-06-30 at 12:37 -0700, Gerrit Huizenga wrote:
> On Thu, 30 Jun 2005 12:08:47 PDT, Chandra Seetharaman wrote:
> > Hi Maeda-san,
> >
> > Thanks for the patch. I agree with the approach.
> >
> > One additional change is needed though...
> > we need some valid number to work with when the user starts to create
> > class and assigning shares. Basically, we should prevent the user from
> > changing shares (from dontcare) of a child class if the total numtasks
> > is "unlimited".
> >
> > See below for coding related comments.
> >
> > On Thu, 2005-06-30 at 17:50 +0900, MAEDA Naoaki wrote:
> > > token = match_token(p, numtasks_tokens, args);
> > > switch (token) {
> > > case numtasks_token_total:
> > > - if (match_int(args, &new_total) ||
> > > - (new_total < total_cnt_alloc)) {
> > > + if ((s = match_strdup(args)) == NULL) {
> > > err = -EINVAL;
> >
> > shouldn't we return -ENOMEM ?
>
> Chandra, why do you think this would be -ENOMEM? There is no memory
> allocation going on here - -ENOMEM refers to a failure to allocate
> kernel or user memory and I don't see such a failure here.
Here is the function match_strdup():
char *match_strdup(substring_t *s)
{
char *p = kmalloc(s->to - s->from + 1, GFP_KERNEL);
if (p)
match_strcpy(p, s);
return p;
}
returns NULL when kmalloc fails.
>
> Specifically, from SuS v4.1:
>
> [ENOMEM] Not enough space
> The new process image requires more memory than is allowed by
> the hardware or system-imposed memory management constraints.
>
> I don't see any way that that applies. EINVAL is better:
>
> [EINVAL] Invalid argument
> Some invalid argument was supplied; (for example, mentioning an
> undefined signal in a signal() function or a kill() function).
>
>
> gerrit
--
----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- [EMAIL PROTECTED] | .......you may get it.
----------------------------------------------------------------------
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech