Commit 5dda5046 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mm: change offset of zero_page_entry to ~0LL

Because 0 is actually a valid value.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 37a6c1fc
...@@ -640,7 +640,7 @@ static int fixup_pages_data(int pid, int fd) ...@@ -640,7 +640,7 @@ static int fixup_pages_data(int pid, int fd)
if (read_img(pgfd, &va) < 0) if (read_img(pgfd, &va) < 0)
goto out; goto out;
if (va == 0) if (final_page_va(va))
break; break;
write(fd, &va, sizeof(va)); write(fd, &va, sizeof(va));
...@@ -656,7 +656,7 @@ static int fixup_pages_data(int pid, int fd) ...@@ -656,7 +656,7 @@ static int fixup_pages_data(int pid, int fd)
if (read_img(pgfd, &va) < 0) if (read_img(pgfd, &va) < 0)
goto out; goto out;
if (va == 0) if (final_page_va(va))
break; break;
if (!should_restore_page(pid, va)) { if (!should_restore_page(pid, va)) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "syscall.h" #include "syscall.h"
static struct cr_options opts; static struct cr_options opts;
struct page_entry zero_page_entry; struct page_entry zero_page_entry = {.va = ~0LL};
/* /*
* The cr fd set is the set of files where the information * The cr fd set is the set of files where the information
...@@ -276,8 +276,6 @@ int main(int argc, char *argv[]) ...@@ -276,8 +276,6 @@ int main(int argc, char *argv[])
action = argv[1][0]; action = argv[1][0];
memzero_p(&zero_page_entry);
/* Default options */ /* Default options */
opts.final_state = TASK_DEAD; opts.final_state = TASK_DEAD;
......
...@@ -194,7 +194,7 @@ struct page_entry { ...@@ -194,7 +194,7 @@ struct page_entry {
u8 data[PAGE_IMAGE_SIZE]; u8 data[PAGE_IMAGE_SIZE];
} __packed; } __packed;
#define final_page_va(va) ((va) == 0) #define final_page_va(va) ((va) == ~0LL)
#define final_page_entry(page_entry) (final_page_va((page_entry)->va)) #define final_page_entry(page_entry) (final_page_va((page_entry)->va))
struct sa_entry { struct sa_entry {
......
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