From f6cc277cada0ad61b3fc017bf213ee4301d8e87f Mon Sep 17 00:00:00 2001 From: Laurent Dufour Date: Thu, 9 Jun 2016 18:59:00 +0300 Subject: [PATCH] test/zdtm : shm-mp fix page size Test should not assume that page size is 4096. The test was failing on ppc64 where page size is usually 64K. Signed-off-by: Laurent Dufour Signed-off-by: Pavel Emelyanov --- test/zdtm/static/shm-mp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/zdtm/static/shm-mp.c b/test/zdtm/static/shm-mp.c index b297d766d..e29904f3a 100644 --- a/test/zdtm/static/shm-mp.c +++ b/test/zdtm/static/shm-mp.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) goto out; } - id = shmget(key, 2 * 4096, 0777 | IPC_CREAT | IPC_EXCL); + id = shmget(key, 2 * PAGE_SIZE, 0777 | IPC_CREAT | IPC_EXCL); if (id == -1) { pr_perror("Can't make seg"); goto out; @@ -86,9 +86,9 @@ int main(int argc, char **argv) } mem[0] = 'R'; - mem[4096] = 'W'; + mem[PAGE_SIZE] = 'W'; - if (mprotect(mem, 4096, PROT_READ)) { + if (mprotect(mem, PAGE_SIZE, PROT_READ)) { pr_perror("Can't mprotect shmem"); goto out_dt; } @@ -98,7 +98,7 @@ int main(int argc, char **argv) if (check_prot(mem, 'R', PROT_READ)) f++; - if (check_prot(mem + 4096, 'W', PROT_READ | PROT_WRITE)) + if (check_prot(mem + PAGE_SIZE, 'W', PROT_READ | PROT_WRITE)) f++;