From f1eb1332b8f07e937add24c6fd2ac40b8737a2f4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 10 Mar 2010 15:23:05 -0800 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- ipc/mqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipc/mqueue.c') diff --git a/ipc/mqueue.c b/ipc/mqueue.c index b6cb06451f4..e4e3f04803c 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -155,7 +155,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, spin_lock(&mq_lock); if (u->mq_bytes + mq_bytes < u->mq_bytes || u->mq_bytes + mq_bytes > - p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur) { + task_rlimit(p, RLIMIT_MSGQUEUE)) { spin_unlock(&mq_lock); kfree(info->messages); goto out_inode; -- cgit v1.2.3-70-g09d2