diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 2 | ||||
-rw-r--r-- | fs/exec.c | 18 |
2 files changed, 4 insertions, 16 deletions
@@ -490,6 +490,8 @@ static void kiocb_batch_free(struct kioctx *ctx, struct kiocb_batch *batch) | |||
490 | kmem_cache_free(kiocb_cachep, req); | 490 | kmem_cache_free(kiocb_cachep, req); |
491 | ctx->reqs_active--; | 491 | ctx->reqs_active--; |
492 | } | 492 | } |
493 | if (unlikely(!ctx->reqs_active && ctx->dead)) | ||
494 | wake_up_all(&ctx->wait); | ||
493 | spin_unlock_irq(&ctx->ctx_lock); | 495 | spin_unlock_irq(&ctx->ctx_lock); |
494 | } | 496 | } |
495 | 497 | ||
@@ -1915,7 +1915,6 @@ static int coredump_wait(int exit_code, struct core_state *core_state) | |||
1915 | { | 1915 | { |
1916 | struct task_struct *tsk = current; | 1916 | struct task_struct *tsk = current; |
1917 | struct mm_struct *mm = tsk->mm; | 1917 | struct mm_struct *mm = tsk->mm; |
1918 | struct completion *vfork_done; | ||
1919 | int core_waiters = -EBUSY; | 1918 | int core_waiters = -EBUSY; |
1920 | 1919 | ||
1921 | init_completion(&core_state->startup); | 1920 | init_completion(&core_state->startup); |
@@ -1927,22 +1926,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state) | |||
1927 | core_waiters = zap_threads(tsk, mm, core_state, exit_code); | 1926 | core_waiters = zap_threads(tsk, mm, core_state, exit_code); |
1928 | up_write(&mm->mmap_sem); | 1927 | up_write(&mm->mmap_sem); |
1929 | 1928 | ||
1930 | if (unlikely(core_waiters < 0)) | 1929 | if (core_waiters > 0) |
1931 | goto fail; | ||
1932 | |||
1933 | /* | ||
1934 | * Make sure nobody is waiting for us to release the VM, | ||
1935 | * otherwise we can deadlock when we wait on each other | ||
1936 | */ | ||
1937 | vfork_done = tsk->vfork_done; | ||
1938 | if (vfork_done) { | ||
1939 | tsk->vfork_done = NULL; | ||
1940 | complete(vfork_done); | ||
1941 | } | ||
1942 | |||
1943 | if (core_waiters) | ||
1944 | wait_for_completion(&core_state->startup); | 1930 | wait_for_completion(&core_state->startup); |
1945 | fail: | 1931 | |
1946 | return core_waiters; | 1932 | return core_waiters; |
1947 | } | 1933 | } |
1948 | 1934 | ||