aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-10-31 12:13:10 -0400
committerTakashi Iwai <tiwai@suse.de>2008-10-31 12:13:10 -0400
commit7b3b6e42032e94a6132a85642e95106f5346650e (patch)
tree8b2262291341d8a9f9b1e7e3c63a3289bb6c6de6 /ipc
parent04172c0b9ea5861e5cba7909da5297b3aedac9e1 (diff)
parent0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff)
Merge commit 'v2.6.28-rc2' into topic/asoc
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_sysctl.c9
-rw-r--r--ipc/mqueue.c20
-rw-r--r--ipc/sem.c2
-rw-r--r--ipc/shm.c6
4 files changed, 24 insertions, 13 deletions
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 69bc85978ba0..0dfebc509426 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -131,7 +131,7 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
131 131
132#ifdef CONFIG_SYSCTL_SYSCALL 132#ifdef CONFIG_SYSCTL_SYSCALL
133/* The generic sysctl ipc data routine. */ 133/* The generic sysctl ipc data routine. */
134static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen, 134static int sysctl_ipc_data(ctl_table *table,
135 void __user *oldval, size_t __user *oldlenp, 135 void __user *oldval, size_t __user *oldlenp,
136 void __user *newval, size_t newlen) 136 void __user *newval, size_t newlen)
137{ 137{
@@ -169,14 +169,13 @@ static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
169 return 1; 169 return 1;
170} 170}
171 171
172static int sysctl_ipc_registered_data(ctl_table *table, int __user *name, 172static int sysctl_ipc_registered_data(ctl_table *table,
173 int nlen, void __user *oldval, size_t __user *oldlenp, 173 void __user *oldval, size_t __user *oldlenp,
174 void __user *newval, size_t newlen) 174 void __user *newval, size_t newlen)
175{ 175{
176 int rc; 176 int rc;
177 177
178 rc = sysctl_ipc_data(table, name, nlen, oldval, oldlenp, newval, 178 rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen);
179 newlen);
180 179
181 if (newval && newlen && rc > 0) 180 if (newval && newlen && rc > 0)
182 /* 181 /*
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/sem.c b/ipc/sem.c
index bf1bc36cb7ee..082122469b17 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -504,7 +504,7 @@ static int count_semzcnt (struct sem_array * sma, ushort semnum)
504 return semzcnt; 504 return semzcnt;
505} 505}
506 506
507void free_un(struct rcu_head *head) 507static void free_un(struct rcu_head *head)
508{ 508{
509 struct sem_undo *un = container_of(head, struct sem_undo, rcu); 509 struct sem_undo *un = container_of(head, struct sem_undo, rcu);
510 kfree(un); 510 kfree(un);
diff --git a/ipc/shm.c b/ipc/shm.c
index e77ec698cf40..867e5d6a55c2 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);
@@ -813,7 +817,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
813 struct ipc_namespace *ns; 817 struct ipc_namespace *ns;
814 struct shm_file_data *sfd; 818 struct shm_file_data *sfd;
815 struct path path; 819 struct path path;
816 mode_t f_mode; 820 fmode_t f_mode;
817 821
818 err = -EINVAL; 822 err = -EINVAL;
819 if (shmid < 0) 823 if (shmid < 0)