Commit 67038451 authored by Pavel Emelyanov's avatar Pavel Emelyanov

ipc: SysVshmem segment can be unaligned

It's possible to create sysvshmem segment with size not being
multiple of page_size. And this very size will be reported
everywhere in the interfaces.

Support this type of segments too.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent f87edfde
......@@ -161,7 +161,7 @@ int fixup_sysv_shmems(void)
* Same thing is checked in open_shmem_sysv() for
* intermediate holes.
*/
if (att->first->start + si->size != att->prev_end) {
if (att->first->start + round_up(si->size, page_size()) != att->prev_end) {
pr_err("Sysv shmem %lx with tail hole not supported\n", si->shmid);
return -1;
}
......
......@@ -137,6 +137,7 @@
/static/session02
/static/session03
/static/shm
/static/shm-unaligned
/static/shm-mp
/static/sigaltstack
/static/signalfd00
......
......@@ -45,6 +45,7 @@ TST_NOFILE = \
inotify_system \
inotify_system_nodel \
shm \
shm-unaligned \
shm-mp \
ptrace_sig \
pipe00 \
......@@ -297,6 +298,9 @@ $(TST_DIR_FILE:%=%.pid): %.pid: %
cmdlinenv00.pid: cmdlinenv00
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out --arg1=arg1 --arg2=arg2 --arg3=arg3
shm-unaligned.pid: shm-unaligned
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out --shmem_size=5000
env00.pid: env00
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out --envname=ENV_00_TEST
umask00.pid: umask00
......
shm.c
\ No newline at end of file
shm.desc
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment