Commit 5306cd0f authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: don't close page-read for child processes

The page-read for child process is a shallow copy of the parent process
page-read. They share the open file descriptors and the pagemap.
The lpi_fini of the child processes should not release any resources, they
all will be released during lpi_fini of the parent process.

Fixes: #325
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 1ad1400c
...@@ -130,14 +130,13 @@ static void free_lazy_iovs(struct lazy_pages_info *lpi) ...@@ -130,14 +130,13 @@ static void free_lazy_iovs(struct lazy_pages_info *lpi)
static void lpi_fini(struct lazy_pages_info *lpi) static void lpi_fini(struct lazy_pages_info *lpi)
{ {
if (!lpi) if (!lpi)
return; return;
free(lpi->buf); free(lpi->buf);
free_lazy_iovs(lpi); free_lazy_iovs(lpi);
if (lpi->lpfd.fd > 0) if (lpi->lpfd.fd > 0)
close(lpi->lpfd.fd); close(lpi->lpfd.fd);
if (lpi->pr.close) if (!lpi->parent && lpi->pr.close)
lpi->pr.close(&lpi->pr); lpi->pr.close(&lpi->pr);
free(lpi); free(lpi);
} }
......
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