Commit c9501e63 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: check grow-down vma-s in cow01

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d9e7f6d1
...@@ -43,6 +43,7 @@ struct test_cases { ...@@ -43,6 +43,7 @@ struct test_cases {
}; };
static int init_cow(struct test_cases *); static int init_cow(struct test_cases *);
static int init_cow_gd(struct test_cases *tcs);
static int init_sep(struct test_cases *); static int init_sep(struct test_cases *);
static int init_file(struct test_cases *); static int init_file(struct test_cases *);
...@@ -52,13 +53,15 @@ static pid_t child_pid; ...@@ -52,13 +53,15 @@ static pid_t child_pid;
int __ret = 0; \ int __ret = 0; \
__ret += func(&sep_tcs); \ __ret += func(&sep_tcs); \
__ret += func(&cow_tcs); \ __ret += func(&cow_tcs); \
__ret += func(&cow_gd_tcs); \
__ret += func(&file_tcs); \ __ret += func(&file_tcs); \
__ret; \ __ret; \
}) })
struct test_cases cow_tcs = {.init = init_cow}, struct test_cases cow_tcs = {.init = init_cow},
sep_tcs = {.init = init_sep}, sep_tcs = {.init = init_sep},
file_tcs = {.init = init_file}; file_tcs = {.init = init_file},
cow_gd_tcs = {.init = init_cow_gd};
uint32_t zero_crc = ~1; uint32_t zero_crc = ~1;
...@@ -236,7 +239,7 @@ static int parent_check(struct test_cases *test_cases) ...@@ -236,7 +239,7 @@ static int parent_check(struct test_cases *test_cases)
return ret; return ret;
} }
static int init_cow(struct test_cases *tcs) static int __init_cow(struct test_cases *tcs, int flags)
{ {
int i; int i;
void *addr; void *addr;
...@@ -259,7 +262,7 @@ static int init_cow(struct test_cases *tcs) ...@@ -259,7 +262,7 @@ static int init_cow(struct test_cases *tcs)
addr += PAGE_SIZE; addr += PAGE_SIZE;
tcs->addr = addr; tcs->addr = addr;
mmap(addr + PAGE_SIZE * TEST_CASES, PAGE_SIZE, PROT_NONE, mmap(addr + PAGE_SIZE * TEST_CASES, PAGE_SIZE, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED | flags, -1, 0);
test_msg("cow_addr=%p\n", addr); test_msg("cow_addr=%p\n", addr);
for (i = 0; i < TEST_CASES; i++) { for (i = 0; i < TEST_CASES; i++) {
...@@ -271,6 +274,16 @@ static int init_cow(struct test_cases *tcs) ...@@ -271,6 +274,16 @@ static int init_cow(struct test_cases *tcs)
return 0; return 0;
} }
static int init_cow(struct test_cases *tcs)
{
return __init_cow(tcs, 0);
}
static int init_cow_gd(struct test_cases *tcs)
{
return __init_cow(tcs, MAP_GROWSDOWN);
}
static int init_sep(struct test_cases *tcs) static int init_sep(struct test_cases *tcs)
{ {
int i; int i;
......
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