diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-03-30 13:20:30 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-04-01 05:00:26 +0200 |
commit | 498052bba55ecaff58db6a1436b0e25bfd75a7ff (patch) | |
tree | bd3644ac60737e3733995a203acebd70cfd1b21b /fs/internal.h | |
parent | Take fs_struct handling to new file (fs/fs_struct.c) (diff) | |
download | linux-498052bba55ecaff58db6a1436b0e25bfd75a7ff.tar.xz linux-498052bba55ecaff58db6a1436b0e25bfd75a7ff.zip |
New locking/refcounting for fs_struct
* all changes of current->fs are done under task_lock and write_lock of
old fs->lock
* refcount is not atomic anymore (same protection)
* its decrements are done when removing reference from current; at the
same time we decide whether to free it.
* put_fs_struct() is gone
* new field - ->in_exec. Set by check_unsafe_exec() if we are trying to do
execve() and only subthreads share fs_struct. Cleared when finishing exec
(success and failure alike). Makes CLONE_FS fail with -EAGAIN if set.
* check_unsafe_exec() may fail with -EAGAIN if another execve() from subthread
is in progress.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/internal.h')
-rw-r--r-- | fs/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/internal.h b/fs/internal.h index 477a105f8df3..b4dac4fb6b61 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -44,7 +44,7 @@ extern void __init chrdev_init(void); /* * exec.c */ -extern void check_unsafe_exec(struct linux_binprm *); +extern int check_unsafe_exec(struct linux_binprm *); /* * namespace.c |