ipc: always handle a new value of auto_msgmni
PATCH 1/1 ipc: always handle a new value of auto_msgmni
proc_dointvec_minmax() returns zero, if a new value has been set. So we don't need to check all charectes have been handled.
Below you can find two examples. In the new value has not been handled properly.
$ strace ./a.out
open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3
write(3, "0\n\0", 3) = 2
close(3) = 0
exit_group(0)
$ cat /sys/kernel/debug/tracing/trace$strace ./a.out open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3write(3, "0\n", 2) = 2
close(3) = 0
$ cat /sys/kernel/debug/tracing/trace a.out-697 [000] .... 3280.998235: unregister_ipcns_notifier <-proc_ipcauto_dointvec_minmax
--- ipc/ipc_sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
ipc/ipc_sysctl.c +1 -2
@@ -123,7 +123,6 @@ static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table ipc_table; -size_t lenp_bef = *lenp;int oldval;int rc;
@@ -133,7 +132,7 @@ static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write, rc =proc_dointvec_minmax (&ipc_table, write, buffer, lenp, ppos); -if (write && !rc && lenp_bef == *lenp) { +if (write && !rc) {int newval = *((int *)(ipc_table.data));/* * The file "auto_msgmni" has correctly been set.
Signature · 1 line
1.9.3
Hi Andrey,
Quoted 2 lines · Andrey Vagin
proc_dointvec_minmax()returns zero, if a new value has been set. So we don't need to check all charectes have been handled.
What do you use auto_msgmni for?
I would propose to remove the whole logic - just always allow 32000 message queues.
--
Manfred
Quoted 6 lines · Manfred Spraul
Hi Andrey,
Quoted 2 lines · Andrey Vagin
proc_dointvec_minmax()returns zero, if a new value has been set. So we don't need to check all charectes have been handled.What do you use
auto_msgmnifor?
We disable it to check that criu restores a value of the msgmni sysctl correctly.
https://github.com/xemul/criu/blob/master/test/zdtm/live/static/ipc_namespace.c
Quoted 3 lines
I would propose to remove the whole logic - just always allow 32000 message queues.
I don't have objections.
Quoted 3 lines
--
Manfred
Hi Andrew,
Quoted 8 lines · Andrew Vagin
Quoted 4 lines · Manfred Spraul
Hi Andrey,
[...]
What do you useauto_msgmnifor?We disable it to check that criu restores a value of the msgmni sysctl correctly.
https://github.com/xemul/criu/blob/master/test/zdtm/live/static/ipc_namespace.c
Thanks for the link, if I see it right, my patch would break your code:
http://marc.info/?l=linux-kernel&m=140782863804950
It removes auto_msgmni - and
What do you think, should I leave auto_msgmni as a stale variable, perhaps with a pr_info() that it doesn't have any effect?
--
Manfred
Quoted 10 lines · Manfred Spraul
Hi Andrew,
Quoted 7 lines · Andrew Vagin
Quoted 4 lines · Manfred Spraul
Hi Andrey,
[...]
What do you useauto_msgmnifor?We disable it to check that criu restores a value of the msgmni sysctl correctly.
Quoted 8 lines
Thanks for the link, if I see it right, my patch would break your code:
http://marc.info/?l=linux-kernel&m=140782863804950
It removes
auto_msgmni- and
What do you think, should I leaveauto_msgmnias a stale variable, perhaps with apr_info()that it doesn't have any effect?
Yes, you should. For example "criu restore" will start failing, if you remove auto_msgmni.
Quoted 4 lines
--
Manfred