| ★ wanayoo — archive 1999 http://kernelnotes.org/patch/21-p0594.html | Nouvelle recherche | Portail wanayoo |
|
Bill Hawes (whawes@star.net) Wed Jun 25 15:00:00 1997 |
[Home] [Linux 2.0] [Linux 2.1] [Information] [Software] [Distributions] [Links] |
|
While checking out some other problems I noticed that occasionally generic_file_read was being passed junk values for the read ahead parameters (f_ralen, etc.). I traced these down to fs/exec.c, which uses a hand-rolled struct file on the stack but doesn't clear the memory first. While it's difficult to analyze the effects of uninitialized variables, it looks like under some circumstances this could result in slower loading of executables.I modified fs/exec.c by writing a routine to properly initialize a struct file for a given inode and mode. As there were nearly identical uses of file structures on the stack in binfmt_elf.c and binfmt_aout.c, I changed these to call the common code.
The following patch (against 2.1.42) fixes the problem.