Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105936
b: refs/heads/master
c: 32ecb1f
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jul 25, 2008
1 parent 35f0841 commit ec7b915
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24d5288f06ed8b3a368eba967d587cdb012dfdf7
refs/heads/master: 32ecb1f26dd50eeaac4e3f4dea4541c97848e459
8 changes: 4 additions & 4 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,13 +1597,13 @@ static int coredump_wait(int exit_code)
{
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm;
struct completion startup_done;
struct core_state core_state;
struct completion *vfork_done;
int core_waiters;

init_completion(&mm->core_done);
init_completion(&startup_done);
mm->core_startup_done = &startup_done;
init_completion(&core_state.startup);
mm->core_state = &core_state;

core_waiters = zap_threads(tsk, mm, exit_code);
up_write(&mm->mmap_sem);
Expand All @@ -1622,7 +1622,7 @@ static int coredump_wait(int exit_code)
}

if (core_waiters)
wait_for_completion(&startup_done);
wait_for_completion(&core_state.startup);
fail:
BUG_ON(mm->core_waiters);
return core_waiters;
Expand Down
7 changes: 6 additions & 1 deletion trunk/include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ struct vm_area_struct {
#endif
};

struct core_state {
struct completion startup;
};

struct mm_struct {
struct vm_area_struct * mmap; /* list of VMAs */
struct rb_root mm_rb;
Expand Down Expand Up @@ -220,7 +224,8 @@ struct mm_struct {
unsigned long flags; /* Must use atomic bitops to access the bits */

/* coredumping support */
struct completion *core_startup_done, core_done;
struct core_state *core_state;
struct completion core_done;

/* aio bits */
rwlock_t ioctx_list_lock; /* aio lock */
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static void exit_mm(struct task_struct * tsk)
up_read(&mm->mmap_sem);
down_write(&mm->mmap_sem);
if (!--mm->core_waiters)
complete(mm->core_startup_done);
complete(&mm->core_state->startup);
up_write(&mm->mmap_sem);

wait_for_completion(&mm->core_done);
Expand Down

0 comments on commit ec7b915

Please sign in to comment.