mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: jirislaby@gmail.com
Cc: linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux390@de.ibm.com, linux-s390@vger.kernel.org
Subject: [PATCH] S390: use helpers for rlimits
Date: Wed,  6 Jan 2010 16:24:32 +0100	[thread overview]
Message-ID: <1262791479-26594-4-git-send-email-jslaby@suse.cz> (raw)
In-Reply-To: <1262791479-26594-1-git-send-email-jslaby@suse.cz>

Make sure compiler won't do weird things with limits. E.g. fetching
them twice may return 2 different values after writable limits are
implemented.

I.e. either use rlimit helpers added in
3e10e716abf3c71bdb5d86b8f507f9e72236c9cd
or ACCESS_ONCE if not applicable.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
---
 arch/s390/mm/mmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index f4558cc..869efba 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -40,7 +40,7 @@
 
 static inline unsigned long mmap_base(void)
 {
-	unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
+	unsigned long gap = rlimit(RLIMIT_STACK);
 
 	if (gap < MIN_GAP)
 		gap = MIN_GAP;
@@ -61,7 +61,7 @@ static inline int mmap_is_legacy(void)
 #endif
 	return sysctl_legacy_va_layout ||
 	    (current->personality & ADDR_COMPAT_LAYOUT) ||
-	    current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY;
+	    rlimit(RLIMIT_STACK) == RLIM_INFINITY;
 }
 
 #ifndef CONFIG_64BIT
-- 
1.6.5.7


  parent reply	other threads:[~2010-01-06 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 15:24 [PATCH] core: posix-cpu-timers, cleanup rlimits usage Jiri Slaby
2010-01-06 15:24 ` [PATCH] IA64: use helpers for rlimits Jiri Slaby
2010-01-06 15:24 ` [PATCH] PPC: " Jiri Slaby
2010-01-06 15:24 ` Jiri Slaby [this message]
2010-01-07  9:24   ` [PATCH] S390: " Martin Schwidefsky
2010-01-06 15:24 ` [PATCH] SPARC: " Jiri Slaby
2010-01-08  8:03   ` David Miller
2010-01-06 15:24 ` [PATCH] X86: " Jiri Slaby
2010-01-06 15:24 ` [PATCH] FS: " Jiri Slaby
2010-01-06 15:24 ` [PATCH] MM: " Jiri Slaby
2010-01-06 15:24 ` [PATCH] core: " Jiri Slaby
2010-01-06 15:24 ` [PATCH] infiniband: " Jiri Slaby
2010-01-06 15:24 ` [PATCH] ipc: " Jiri Slaby

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=1262791479-26594-4-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    /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

all inboxes | Powered by JetHome®