[OpenAFS] Re: 1.4.x, select() and recent RHEL kernels beware

Andrew Deason adeason@sinenomine.net
Fri, 9 Nov 2012 10:57:51 -0600


On Fri, 9 Nov 2012 10:29:13 +0000
Dan Van Der Ster <daniel.vanderster@cern.ch> wrote:

> BTW, in fssync and salvsync and a couple other places in the code we
> see:
>     #define FD_SETSIZE 65536
> 
> Naive question… would an alternative "fix" here be to do something
> like:
> 
> #ifdef LINUX
>     #define FD_SETSIZE 1024
> #endif
> 
> then AFS would work independent of the ulimit, (at least until
> select() is removed everywhere)?

No, in fact, the way that the headers work, we're already effectively
doing that. We define FD_SETSIZE to be 65536, and later on the headers
redefine it to be 1024.

And although there are other uses of select(), I think the fssync code
seems to be the only place this can be a problem; the salvsync code
should not involve high-numbered file descriptors. The only other uses
are small utilities, like stuff that uses lwp.


By the way, all other unixes I am aware of allow you to change
FD_SETSIZE as the comments suggest; it is only on Linux where this is
silently ignored, causing bit flips. This behavior change to expose
"dangerous" applications seems to cause traditional unix programs
possibily written decades ago to suddenly cause bit flips after that
mentioned version. Not even, say, assert()...

-- 
Andrew Deason
adeason@sinenomine.net