stdio in smbd

Andy Polyakov appro at fy.chalmers.se
Wed Feb 27 01:57:05 GMT 2002


Hi,

> > . For further discussions and workarounds see "Proposed
> > > patch for Samba-2.0.7 to allow Solaris open more than 1014 (or
> > > rlim_fd_max) files" *thread* at
> > > http://lists.samba.org/pipermail/samba-technical/2001-January/thread.html#27212.
> > > I can only add that following is also essential:
> > >
> > > *** lib/util.c.orig     Sat Oct 13 23:09:26 2001
> > > --- lib/util.c  Thu Dec  6 01:47:44 2001
> > > ***************
> > > *** 1535,1540 ****
> > > --- 1535,1543 ----
> > >         if (rlp.rlim_max != RLIM_INFINITY) {
> > >                 int orig_max = rlp.rlim_max;
> > >
> > > +               if (requested_max > FD_SETSIZE)
> > > +                       requested_max = FD_SETSIZE;
> > > +
> > >                 if ( rlp.rlim_max < requested_max )
> > >                         rlp.rlim_max = requested_max;
> > >
> > > A.
> >
> >
> >       Ok folks, can we get this diagnosis
> >       verified and checked in, then?
> 
> No, this is a bad fix for anything but Solaris I'm
> afraid. We don't want to limit requested_max to FD_SETSIZE
> which is quite small.

Of course it's Solaris specific. Because I'm not sort of nominating a
patch or anything, but trying to deliver a point. The above should be
treated a sentence, as an *complementary* sentence to the previous
discussion. I probably should have recaped my standpoint. Here it goes.

IMO Samba sys_select should implement *own* front-end to poll(2) on [at
least] Solaris. Similar to the way it was back in 2.0.[6]. But you can't
just take one from 2.0.[6] as it could't manage more than 256
descriptors at a time, I mean you couldn't poll for more than 256
descriptors out of maxfd. Now when it comes to implementing of own
front-end to poll(2) a question arises. Do we implement so to say
"bottom-less" front-end which accepts whatever maxfd value or do we set
some hard limit and return error. Now Sun sets hard limit to FD_SETSIZE,
and if we do so as well (provided that we -DFD_SETSIZE=<more resonable
value> in command line!!!), then we should consider complementing the
code adjusting rlp.rlim_max with something similar to the above
(provided that it's surrounded by same #ifdef as own front-end to poll).
Alternatively we could implement "bottom-less" front-end which would
simply obsolete the above code.

But whichever option is chosen, something ought to be done about stdio
256 limitation. The suggestion was to shuffle file descriptors returned
by open(2) and creat(2) above 256 as depicted in
http://lists.samba.org/pipermail/samba-ntdom/1999-August/019940.html.

Should I make a suggestion by nominating a patch addressing both
problems?

Cheers. A.




More information about the samba-technical mailing list