On Wed, Apr 09, 2025 at 03:30:32PM -0600, Shuah Khan wrote:
> On 4/8/25 23:56, Petr Vorel wrote:
> > > On 3/31/25 19:55, lufei wrote:
> > > > Set maximum file descriptor number limit by rlimit.rlim_max than
> > > > nr_open(hard limit). Hard limit may cause dup2 fail.
> > 
> > > > Signed-off-by: lufei <[email protected]>
> > 
> > > Petr, Al,
> > 
> > > Okay to take this patch?
> > 
> > LGTM, hopefully I haven't overlook anything.
> > 
> > Reviewed-by: Petr Vorel <[email protected]>
> > 
> > FYI Cyril Hrubis suggested a different approach (for LTP tests which is 
> > based on
> > this Al's test):
> > 
> > https://lore.kernel.org/ltp/[email protected]/
> > https://lore.kernel.org/ltp/[email protected]/
> > 
> >     filedescriptor that is >= 64 and set the nr_open to 64.
> > 
> > That would help to avoid using /proc/sys/fs/nr_open.
> > 
> 
> Thank you for this suggestion.
> 
> lufei, Can you look into this as a solution? Also the short log
> should include the subsystem: e.:
> 
> selftests:core: unshare_test: -----
> 
> thanks,
> -- Shuah
> 

Hi Shuah,

Thanks very much for reply.

I'll submit a v3 patch with dup a filedescriptor >= sizeof(long)*8 and
set nr_open to sizeof(long)*8 to trigger EMFILE.

Hi Petr, Shuah, I don't have a i686 environment, only on x86_64 has been
tested. Is this all right?

I'll re-write short log as asked in v3 patch.


Reply via email to