diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-05 16:42:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:29 -0500 |
commit | d554ed895dc8f293cc712c71f14b101ace82579a (patch) | |
tree | fd29ba33d640e156e2ca4267ffbdb9dc566fd3d6 /fs/proc | |
parent | 221e3ebf6d5f2625373573155924e39f196c5d3d (diff) |
fs: use rlimit helpers
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 commit 3e10e716abf3 ("resource:
add helpers for fetching rlimits") or ACCESS_ONCE if not applicable.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 18e20feee251..aa8637b81028 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -273,7 +273,7 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p) | |||
273 | rcu_read_lock(); /* FIXME: is this correct? */ | 273 | rcu_read_lock(); /* FIXME: is this correct? */ |
274 | qsize = atomic_read(&__task_cred(p)->user->sigpending); | 274 | qsize = atomic_read(&__task_cred(p)->user->sigpending); |
275 | rcu_read_unlock(); | 275 | rcu_read_unlock(); |
276 | qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; | 276 | qlim = task_rlimit(p, RLIMIT_SIGPENDING); |
277 | unlock_task_sighand(p, &flags); | 277 | unlock_task_sighand(p, &flags); |
278 | } | 278 | } |
279 | 279 | ||
@@ -420,7 +420,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
420 | cutime = sig->cutime; | 420 | cutime = sig->cutime; |
421 | cstime = sig->cstime; | 421 | cstime = sig->cstime; |
422 | cgtime = sig->cgtime; | 422 | cgtime = sig->cgtime; |
423 | rsslim = sig->rlim[RLIMIT_RSS].rlim_cur; | 423 | rsslim = ACCESS_ONCE(sig->rlim[RLIMIT_RSS].rlim_cur); |
424 | 424 | ||
425 | /* add up live thread stats at the group level */ | 425 | /* add up live thread stats at the group level */ |
426 | if (whole) { | 426 | if (whole) { |