Subject: Re: [PATCH] net: remove member 'max' of struct scm_fp_list

From: yuan linyu <[email-masked]>
Date: Sat, 11 Feb 2017 10:04:22 +0800

On 五, 2017-02-10 at 10:25 -0500, David Miller wrote:
> From: yuan linyu <[email-masked]>
> Date: Fri, 10 Feb 2017 20:11:13 +0800
> 
> > From: yuan linyu <[email-masked]>
> > 
> > SCM_MAX_FD can fully replace it.
> > 
> > Signed-off-by: yuan linyu <[email-masked]>
> 
> I don't think so:
> 
> > @@ -341,7 +332,6 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
> >       if (new_fpl) {
> >               for (i = 0; i < fpl->count; i++)
> >                       get_file(fpl->fp[i]);
> > -             new_fpl->max = new_fpl->count;
> >               new_fpl->user = get_uid(fpl->user);
> 
> It's not set the SCM_MAX_FD here, it's set to whatever fpl->count is.
> 
> In other words, your patch breaks things.
maybe it's not good to "SCM_MAX_FD can fully replace it".
actually 'max' field is useless.'count' field is enough.