| From | Topi Miettinen <> | Subject | [RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max | Date | Mon, 13 Jun 2016 22:44:22 +0300 |
| |
Track maximum size of message queues, presented in /proc/self/limits.
Signed-off-by: Topi Miettinen <toiwoton@gmail.com> --- 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
|