diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/msg.c | 13 | ||||
-rw-r--r-- | ipc/shm.c | 18 |
2 files changed, 14 insertions, 17 deletions
@@ -98,20 +98,15 @@ void recompute_msgmni(struct ipc_namespace *ns) | |||
98 | 98 | ||
99 | if (allowed < MSGMNI) { | 99 | if (allowed < MSGMNI) { |
100 | ns->msg_ctlmni = MSGMNI; | 100 | ns->msg_ctlmni = MSGMNI; |
101 | goto out_callback; | 101 | return; |
102 | } | 102 | } |
103 | 103 | ||
104 | if (allowed > IPCMNI / nb_ns) { | 104 | if (allowed > IPCMNI / nb_ns) { |
105 | ns->msg_ctlmni = IPCMNI / nb_ns; | 105 | ns->msg_ctlmni = IPCMNI / nb_ns; |
106 | goto out_callback; | 106 | return; |
107 | } | 107 | } |
108 | 108 | ||
109 | ns->msg_ctlmni = allowed; | 109 | ns->msg_ctlmni = allowed; |
110 | |||
111 | out_callback: | ||
112 | |||
113 | printk(KERN_INFO "msgmni has been set to %d for ipc namespace %p\n", | ||
114 | ns->msg_ctlmni, ns); | ||
115 | } | 110 | } |
116 | 111 | ||
117 | void msg_init_ns(struct ipc_namespace *ns) | 112 | void msg_init_ns(struct ipc_namespace *ns) |
@@ -136,6 +131,10 @@ void msg_exit_ns(struct ipc_namespace *ns) | |||
136 | void __init msg_init(void) | 131 | void __init msg_init(void) |
137 | { | 132 | { |
138 | msg_init_ns(&init_ipc_ns); | 133 | msg_init_ns(&init_ipc_ns); |
134 | |||
135 | printk(KERN_INFO "msgmni has been set to %d\n", | ||
136 | init_ipc_ns.msg_ctlmni); | ||
137 | |||
139 | ipc_init_proc_interface("sysvipc/msg", | 138 | ipc_init_proc_interface("sysvipc/msg", |
140 | " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", | 139 | " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", |
141 | IPC_MSG_IDS, sysvipc_msg_proc_show); | 140 | IPC_MSG_IDS, sysvipc_msg_proc_show); |
@@ -894,8 +894,6 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
894 | if (!sfd) | 894 | if (!sfd) |
895 | goto out_put_dentry; | 895 | goto out_put_dentry; |
896 | 896 | ||
897 | err = -ENOMEM; | ||
898 | |||
899 | file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations); | 897 | file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations); |
900 | if (!file) | 898 | if (!file) |
901 | goto out_free; | 899 | goto out_free; |
@@ -1060,16 +1058,16 @@ asmlinkage long sys_shmdt(char __user *shmaddr) | |||
1060 | static int sysvipc_shm_proc_show(struct seq_file *s, void *it) | 1058 | static int sysvipc_shm_proc_show(struct seq_file *s, void *it) |
1061 | { | 1059 | { |
1062 | struct shmid_kernel *shp = it; | 1060 | struct shmid_kernel *shp = it; |
1063 | char *format; | ||
1064 | 1061 | ||
1065 | #define SMALL_STRING "%10d %10d %4o %10u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" | 1062 | #if BITS_PER_LONG <= 32 |
1066 | #define BIG_STRING "%10d %10d %4o %21u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" | 1063 | #define SIZE_SPEC "%10lu" |
1064 | #else | ||
1065 | #define SIZE_SPEC "%21lu" | ||
1066 | #endif | ||
1067 | 1067 | ||
1068 | if (sizeof(size_t) <= sizeof(int)) | 1068 | return seq_printf(s, |
1069 | format = SMALL_STRING; | 1069 | "%10d %10d %4o " SIZE_SPEC " %5u %5u " |
1070 | else | 1070 | "%5lu %5u %5u %5u %5u %10lu %10lu %10lu\n", |
1071 | format = BIG_STRING; | ||
1072 | return seq_printf(s, format, | ||
1073 | shp->shm_perm.key, | 1071 | shp->shm_perm.key, |
1074 | shp->shm_perm.id, | 1072 | shp->shm_perm.id, |
1075 | shp->shm_perm.mode, | 1073 | shp->shm_perm.mode, |