RE: A field in files_struct has been used without initialization

From: Abd-Alrhman Masalkhi
Date: Sun Oct 09 2022 - 05:33:17 EST


Hello Al Viro

> close_on_exec_init is an array, and this assignment stores the address
> of its first (and only) element into newf->fdtab.close_on_exec. So it's
> basically
> newf->fdtab.close_on_exec = &newf->close_on_exec_init[0];
>
> ->fdtab and ->close_on_exec_init are to be used only if we need no more than
> BITS_PER_LONG descriptors. It's common enough to make avoiding a separate
> allocation (and separate cacheline on following the pointer chain) worth
> the trouble
> ...
> ...

Fascinating, thank you for this very informative response. I have learned a
lot from it.