diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-06-02 17:59:43 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-02 17:59:43 -0700 |
| commit | eb313b410e0df742ad69f91173e26e356edd0d4f (patch) | |
| tree | efd3c2bb88676c8f1402e7ce8550f57d86979af2 /fs/exec.c | |
| parent | ce247d90f8263304a25e2b5ac61528e4f0b79b5d (diff) | |
[PATCH] sched: balance-on-exec fix
From: Jack Steiner <steiner@sgi.com>
It looks like the call to sched_balance_exec() from do_execve() is in the
wrong spot. The code calls sched_balance_exec() before determining whether
"filename" actually exists.
In many cases, users have several entries in $PATH. If a full path name is
not specified on the 'exec" call, the library code iterates thru the files
in the PATH list until it finds the program. This can result is numerous
migrations of the parent process before the program is actually found.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c index 4b7f44fb49ef..f30b49540adb 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1074,14 +1074,14 @@ int do_execve(char * filename, int retval; int i; - sched_balance_exec(); - file = open_exec(filename); retval = PTR_ERR(file); if (IS_ERR(file)) return retval; + sched_balance_exec(); + bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0])); |
