[RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max
From: Topi Miettinen
Date: Mon Jun 13 2016 - 15:48:36 EST
Track maximum size of message queues, presented in /proc/self/limits.
Signed-off-by: Topi Miettinen <toiwoton@xxxxxxxxx>
---
ipc/mqueue.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index ade739f..edccf55 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -287,6 +287,8 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
/* all is ok */
info->user = get_uid(u);
+ /* XXX resource limits apply per task, not per user */
+ bump_rlimit(RLIMIT_MSGQUEUE, u->mq_bytes);
} else if (S_ISDIR(mode)) {
inc_nlink(inode);
/* Some things misbehave if size == 0 on a directory */
--
2.8.1