Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165684
b: refs/heads/master
c: 61be228
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and Linus Torvalds committed Sep 24, 2009
1 parent b97ae8e commit 25fba1b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a293980c2e261bd5b0d2a77340dd04f684caff58
refs/heads/master: 61be228a06dc6e8662f30e89eda3c12083c1f379
26 changes: 26 additions & 0 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <linux/kmod.h>
#include <linux/fsnotify.h>
#include <linux/fs_struct.h>
#include <linux/pipe_fs_i.h>

#include <asm/uaccess.h>
#include <asm/mmu_context.h>
Expand Down Expand Up @@ -1729,6 +1730,29 @@ int get_dumpable(struct mm_struct *mm)
return (ret >= 2) ? 2 : ret;
}

static void wait_for_dump_helpers(struct file *file)
{
struct pipe_inode_info *pipe;

pipe = file->f_path.dentry->d_inode->i_pipe;

pipe_lock(pipe);
pipe->readers++;
pipe->writers--;

while ((pipe->readers > 1) && (!signal_pending(current))) {
wake_up_interruptible_sync(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
pipe_wait(pipe);
}

pipe->readers--;
pipe->writers++;
pipe_unlock(pipe);

}


void do_coredump(long signr, int exit_code, struct pt_regs *regs)
{
struct core_state core_state;
Expand Down Expand Up @@ -1886,6 +1910,8 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
if (retval)
current->signal->group_exit_code |= 0x80;
close_fail:
if (ispipe && core_pipe_limit)
wait_for_dump_helpers(file);
filp_close(file, NULL);
fail_dropcount:
if (dump_count)
Expand Down

0 comments on commit 25fba1b

Please sign in to comment.