Subject: Re: Netchannles: first stage has been completed. Further ideas.

From: Evgeniy Polyakov <[email-masked]>
Date: Tue, 18 Jul 2006 15:51:25 +0400

On Tue, Jul 18, 2006 at 01:16:18PM +0200, Christian Borntraeger ([email-masked]) wrote:
> Hello Evgeniy,
> 
> > +asmlinkage long sys_netchannel_control(void __user *arg)
> [...]
> > +	if (copy_from_user(&ctl, arg, sizeof(struct unetchannel_control)))
> > +		return -ERESTARTSYS;
>                         ^^^^^^^^^^^
> [...]
> > +	if (copy_to_user(arg, &ctl, sizeof(struct unetchannel_control)))
> > +		return -ERESTARTSYS;
>                         ^^^^^^^^^^^
> 
> I think this should be -EFAULT instead of -ERESTARTSYS, right?

I have no strong feeling on what must be returned in that case.
As far as I see, copy*user can fail due to absence of the next
destination page, so -ERESTARTSYS makes sence, but if failure happens due to
process size limitation, -EFAULT is correct.

Let's change it to -EFAULT.

> -- 
> Mit freundlichen Grüßen / Best Regards
> 
> Christian Borntraeger
> Linux Software Engineer zSeries Linux & Virtualization

-- 
	Evgeniy Polyakov