[PATCH] acct_stack_growth nitpicks

From: Chris Wright
Date: Mon Jan 10 2005 - 22:56:30 EST


- remove duplicate rlim assignment in acct_stack_growth()
- allow CAP_IPC_LOCK to override mlock rlimit during stack expansion as
in all other cases

Signed-off-by: Chris Wright <chrisw@xxxxxxxx>

===== mm/mmap.c 1.155 vs edited =====
--- 1.155/mm/mmap.c 2005-01-10 11:23:35 -08:00
+++ edited/mm/mmap.c 2005-01-10 19:34:05 -08:00
@@ -1346,7 +1346,6 @@ static int acct_stack_growth(struct vm_a
struct rlimit *rlim = current->signal->rlim;

/* address space limit tests */
- rlim = current->signal->rlim;
if (mm->total_vm + grow > rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT)
return -ENOMEM;

@@ -1360,7 +1359,7 @@ static int acct_stack_growth(struct vm_a
unsigned long limit;
locked = mm->locked_vm + grow;
limit = rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT;
- if (locked > limit)
+ if (locked > limit && !capable(CAP_IPC_LOCK))
return -ENOMEM;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/