[CRIU] [PATCH 2/4] lazy-pages: handle_exit: set uffd to negative value instead of 0

Mike Rapoport rppt at linux.vnet.ibm.com
Tue May 15 23:42:23 MSK 2018


The only use for the userfault file descriptor after the process exited is
for debug logs. Using negative value instead of 0 makes logs more readable.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index e60c782..3fbc5c4 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -789,7 +789,7 @@ static int handle_exit(struct lazy_pages_info *lpi)
 		return -1;
 	free_iovs(lpi);
 	close(lpi->lpfd.fd);
-	lpi->lpfd.fd = 0;
+	lpi->lpfd.fd = -lpi->lpfd.fd;
 	lpi->exited = true;
 
 	/* keep it for tracking in-flight requests and for the summary */
-- 
2.7.4



More information about the CRIU mailing list