diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-10 18:23:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:39 -0500 |
commit | f1eb1332b8f07e937add24c6fd2ac40b8737a2f4 (patch) | |
tree | 43bfaac596ae20dcab088b870406e58a2bb4b78a /ipc/mqueue.c | |
parent | d6db2ade10852b7c665b361239c3411abaa880b5 (diff) |
ipc: 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
3e10e716abf3c71bdb5d86b8f507f9e72236c9cd ("resource: add helpers for
fetching rlimits") or ACCESS_ONCE if not applicable.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index b6cb06451f4b..e4e3f04803ca 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -155,7 +155,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, | |||
155 | spin_lock(&mq_lock); | 155 | spin_lock(&mq_lock); |
156 | if (u->mq_bytes + mq_bytes < u->mq_bytes || | 156 | if (u->mq_bytes + mq_bytes < u->mq_bytes || |
157 | u->mq_bytes + mq_bytes > | 157 | u->mq_bytes + mq_bytes > |
158 | p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur) { | 158 | task_rlimit(p, RLIMIT_MSGQUEUE)) { |
159 | spin_unlock(&mq_lock); | 159 | spin_unlock(&mq_lock); |
160 | kfree(info->messages); | 160 | kfree(info->messages); |
161 | goto out_inode; | 161 | goto out_inode; |