Skip to content

Commit

Permalink
[POWERPC] spufs: Respect RLIMIT_CORE in spu coredump code
Browse files Browse the repository at this point in the history
Currently the spu coredump code doesn't respect the ulimit, it should.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Sep 19, 2007
1 parent 7af1443 commit 9e25ae6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/platforms/cell/spufs/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
*/
static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
{
unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
ssize_t written;

if (*foffset + nr > limit)
return -EIO;

written = file->f_op->write(file, addr, nr, &file->f_pos);
*foffset += written;

Expand Down

0 comments on commit 9e25ae6

Please sign in to comment.