linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] acct_stack_growth nitpicks
Date: Mon, 10 Jan 2005 19:49:36 -0800	[thread overview]
Message-ID: <20050110194936.O2357@build.pdx.osdl.net> (raw)
In-Reply-To: <20050110164214.J2357@build.pdx.osdl.net>; from chrisw@osdl.org on Mon, Jan 10, 2005 at 04:42:14PM -0800

- 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@osdl.org>

===== 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;
 	}
 

      reply	other threads:[~2005-01-11  3:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11  0:42 [PATCH] remove duplicate rlim assignment in acct_stack_growth() Chris Wright
2005-01-11  3:49 ` Chris Wright [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050110194936.O2357@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).