[Devel] Re: [PATCH 11/11][v15]: Document sys_eclone

Arnd Bergmann arnd at arndb.de
Mon Jul 5 03:34:40 PDT 2010


On Monday 05 July 2010, Albert Cahalan wrote:
> On Sun, Jul 4, 2010 at 7:39 PM, Matt Helsley <matthltc at us.ibm.com> wrote:
> > On Sat, Jul 03, 2010 at 07:41:30PM -0400, Albert Cahalan wrote:
> >> <sukadev at linux.vnet.ibm.com> wrote:
> >> > +
> >> > +sys_eclone(u32 flags_low, struct clone_args * __user cargs, int cargs_size,
> >> > +               pid_t * __user pids)
> >>
> >> I don't see why cargs_size is needed for expansion if you have flags.
> >
> > I think it's cleaner this way. The alternative you seem to be hinting at
> > is:
> >
> > If we used a flag bit to indicate an expansion of the parameters then it
> > would only be able to specify one expansion before we'd have to start
> > using bits in the args structure itself. Using those extra bits is
> > quite gross -- we'd have to copy the initial portion of the struct, decode
> > the bit(s) describing the size, and then copy the rest. Also, do we have
> > any bits left in flags_low? I thought those were all used up...
> 
> You'd be copying from a struct in userspace to some random local
> variables in the kernel. There is no reason why the kernel would
> have to use a struct at all. You copy the flags, then see what else
> you need to copy.

Exactly. The size argument is also my main criticism of the suggested
syscall, and I've been arguing the same as you.

Note that you may still use copy the entire struct, provided that we
leave enough reserved fields at the end for future extensions. If
we run out of space ten years from now, we can still have a new syscall
number with a new structure.

	Arnd
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list