linux/include
Oleg Nesterov d0bd587a80 usermodehelper: implement UMH_KILLABLE
Implement UMH_KILLABLE, should be used along with UMH_WAIT_EXEC/PROC.
The caller must ensure that subprocess_info->path/etc can not go away
until call_usermodehelper_freeinfo().

call_usermodehelper_exec(UMH_KILLABLE) does
wait_for_completion_killable.  If it fails, it uses
xchg(&sub_info->complete, NULL) to serialize with umh_complete() which
does the same xhcg() to access sub_info->complete.

If call_usermodehelper_exec wins, it can safely return.  umh_complete()
should get NULL and call call_usermodehelper_freeinfo().

Otherwise we know that umh_complete() was already called, in this case
call_usermodehelper_exec() falls back to wait_for_completion() which
should succeed "very soon".

Note: UMH_NO_WAIT == -1 but it obviously should not be used with
UMH_KILLABLE.  We delay the neccessary cleanup to simplify the back
porting.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:41 -07:00
..
acpi
asm-generic consolidate WARN_...ONCE() static variables 2012-03-23 16:58:31 -07:00
crypto crypto: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
drm headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
keys
linux usermodehelper: implement UMH_KILLABLE 2012-03-23 16:58:41 -07:00
math-emu
media
misc
mtd
net poll: add poll_requested_events() and poll_does_not_wait() functions 2012-03-23 16:58:38 -07:00
pcmcia
rdma Merge branches 'cma', 'cxgb3', 'cxgb4', 'ehca', 'iser', 'mad', 'nes', 'qib', 'srp' and 'srpt' into for-next 2012-03-19 09:50:33 -07:00
rxrpc
scsi headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
sound headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
target target: Use array_zalloc for device_list 2012-03-15 19:15:51 -07:00
trace NFS client updates for Linux 3.4 2012-03-23 08:53:47 -07:00
video fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info 2012-03-21 07:24:01 +00:00
xen include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...) 2012-03-23 16:58:36 -07:00
Kbuild