[CRIU] [PATCH] util: apply PME_PFRAME_MASK to get pfn

Andrey Vagin avagin at openvz.org
Fri Jan 31 02:16:28 PST 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 util.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/util.c b/util.c
index ef90413..85ff155 100644
--- a/util.c
+++ b/util.c
@@ -38,6 +38,7 @@
 #include "rst-malloc.h"
 #include "image.h"
 #include "vma.h"
+#include "mem.h"
 
 #include "cr_options.h"
 #include "servicefd.h"
@@ -649,8 +650,10 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
 	if (ret != sizeof(*pfn)) {
 		pr_perror("Can't read pme for pid %d", getpid());
 		ret = -1;
-	} else
+	} else {
+		*pfn &= PME_PFRAME_MASK;
 		ret = 0;
+	}
 out:
 	close(fd);
 	return ret;
-- 
1.8.3.1



More information about the CRIU mailing list