Commit 74a2cce1 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

page-pipe: Don't increase the page_pipe::nr_pipes if we reuse pipes

The page-pipe buffers may be reused once queued pages are
dumped, but we happen to increase page_pipe::nr_pipes
all the timer, regardless the fact where page buffer
came from.

In worst scenario this may lead to incorrect -EAGAIN returned
from page_pipe_grow forcing calling code to create new
pipes. This is not critical but should be fixed.

In other words page_pipe::nr_pipes must track _really_
created pipes.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 54a996b0
......@@ -34,6 +34,7 @@ static int page_pipe_grow(struct page_pipe *pp)
}
ppb->pipe_size = fcntl(ppb->p[0], F_GETPIPE_SZ, 0) / PAGE_SIZE;
pp->nr_pipes++;
list_add_tail(&ppb->l, &pp->bufs);
out:
......@@ -41,8 +42,6 @@ out:
ppb->nr_segs = 0;
ppb->iov = &pp->iovs[pp->free_iov];
pp->nr_pipes++;
return 0;
}
......
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