[CRIU] [PATCH] page-xfer: bug, don't open page-read for shmem

Tikhomirov Pavel snorcht at gmail.com
Wed Feb 19 03:05:09 PST 2014


it was error if come to that point from shmem.c
388L: err = open_page_xfer(&xfer, CR_FD_SHMEM_PAGEMAP, si->shmid);

Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
---
 page-xfer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/page-xfer.c b/page-xfer.c
index 2efbc5c..f13b0ac 100644
--- a/page-xfer.c
+++ b/page-xfer.c
@@ -641,12 +641,11 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id)
 	 * 2) when writing a hole, the respective place would be checked
 	 *    to exist in parent (either pagemap or hole)
 	 */
-	{
+	xfer->parent = NULL;
+	if (fd_type == CR_FD_PAGEMAP) {
 		int ret;
 		int pfd;
 
-		xfer->parent = NULL;
-
 		pfd = openat(get_service_fd(IMG_FD_OFF), CR_PARENT_LINK, O_RDONLY);
 		if (pfd < 0 && errno == ENOENT)
 			goto out;
-- 
1.8.3.2



More information about the CRIU mailing list