Re: [PATH v2 net-next] net: remove member 'max' of struct scm_fp_list

2017-02-12 Thread Sergei Shtylyov
On 2/11/2017 5:36 AM, yuan linyu wrote: From: yuan linyu 'max' only used at three places in scm.c, 1. in scm_fp_copy(), fpl->max = SCM_MAX_FD; 2. in scm_fp_copy(), if (fpl->count + num > fpl->max) 3. in scm_fp_dup(), new_fpl->max = new_fpl->count; at place 2, fpl->max can be replaced with SCM_

Re: [PATH v2 net-next] net: remove member 'max' of struct scm_fp_list

2017-02-10 Thread yuan linyu
hi, yes, my misunderstanding. it's error when use after dup. can we do a full size(SCM_MAX_FD) dup?   On 六, 2017-02-11 at 10:36 +0800, yuan linyu wrote: > From: yuan linyu > > 'max' only used at three places in scm.c, > 1. in scm_fp_copy(), fpl->max = SCM_MAX_FD; > 2. in scm_fp_copy(), if (fpl

[PATH v2 net-next] net: remove member 'max' of struct scm_fp_list

2017-02-10 Thread yuan linyu
From: yuan linyu 'max' only used at three places in scm.c, 1. in scm_fp_copy(), fpl->max = SCM_MAX_FD; 2. in scm_fp_copy(), if (fpl->count + num > fpl->max) 3. in scm_fp_dup(), new_fpl->max = new_fpl->count; at place 2, fpl->max can be replaced with SCM_MAX_FD. no other place read this 'max' agai