aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c20
-rw-r--r--ipc/shm.c4
2 files changed, 18 insertions, 6 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 96fb36cd9874..68eb857cfdea 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -52,6 +52,14 @@
52#define HARD_MSGMAX (131072/sizeof(void*)) 52#define HARD_MSGMAX (131072/sizeof(void*))
53#define DFLT_MSGSIZEMAX 8192 /* max message size */ 53#define DFLT_MSGSIZEMAX 8192 /* max message size */
54 54
55/*
56 * Define the ranges various user-specified maximum values can
57 * be set to.
58 */
59#define MIN_MSGMAX 1 /* min value for msg_max */
60#define MAX_MSGMAX HARD_MSGMAX /* max value for msg_max */
61#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */
62#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */
55 63
56struct ext_wait_queue { /* queue of sleeping tasks */ 64struct ext_wait_queue { /* queue of sleeping tasks */
57 struct task_struct *task; 65 struct task_struct *task;
@@ -134,8 +142,8 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
134 info->qsize = 0; 142 info->qsize = 0;
135 info->user = NULL; /* set when all is ok */ 143 info->user = NULL; /* set when all is ok */
136 memset(&info->attr, 0, sizeof(info->attr)); 144 memset(&info->attr, 0, sizeof(info->attr));
137 info->attr.mq_maxmsg = DFLT_MSGMAX; 145 info->attr.mq_maxmsg = msg_max;
138 info->attr.mq_msgsize = DFLT_MSGSIZEMAX; 146 info->attr.mq_msgsize = msgsize_max;
139 if (attr) { 147 if (attr) {
140 info->attr.mq_maxmsg = attr->mq_maxmsg; 148 info->attr.mq_maxmsg = attr->mq_maxmsg;
141 info->attr.mq_msgsize = attr->mq_msgsize; 149 info->attr.mq_msgsize = attr->mq_msgsize;
@@ -1191,11 +1199,11 @@ static struct file_system_type mqueue_fs_type = {
1191 .kill_sb = kill_litter_super, 1199 .kill_sb = kill_litter_super,
1192}; 1200};
1193 1201
1194static int msg_max_limit_min = DFLT_MSGMAX; 1202static int msg_max_limit_min = MIN_MSGMAX;
1195static int msg_max_limit_max = HARD_MSGMAX; 1203static int msg_max_limit_max = MAX_MSGMAX;
1196 1204
1197static int msg_maxsize_limit_min = DFLT_MSGSIZEMAX; 1205static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
1198static int msg_maxsize_limit_max = INT_MAX; 1206static int msg_maxsize_limit_max = MAX_MSGSIZEMAX;
1199 1207
1200static ctl_table mq_sysctls[] = { 1208static ctl_table mq_sysctls[] = {
1201 { 1209 {
diff --git a/ipc/shm.c b/ipc/shm.c
index e77ec698cf40..0add3fa5f547 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -737,6 +737,10 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
737 case SHM_LOCK: 737 case SHM_LOCK:
738 case SHM_UNLOCK: 738 case SHM_UNLOCK:
739 { 739 {
740 struct file *uninitialized_var(shm_file);
741
742 lru_add_drain_all(); /* drain pagevecs to lru lists */
743
740 shp = shm_lock_check(ns, shmid); 744 shp = shm_lock_check(ns, shmid);
741 if (IS_ERR(shp)) { 745 if (IS_ERR(shp)) {
742 err = PTR_ERR(shp); 746 err = PTR_ERR(shp);