Commit 3929c853 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

page-xfer: print error message if splice failed

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8a6c1502
......@@ -473,8 +473,16 @@ static int write_pagemap_loc(struct page_xfer *xfer,
static int write_pages_loc(struct page_xfer *xfer,
int p, unsigned long len)
{
if (splice(p, NULL, xfer->fd_pg, NULL, len, SPLICE_F_MOVE) != len)
ssize_t ret;
ret = splice(p, NULL, xfer->fd_pg, NULL, len, SPLICE_F_MOVE);
if (ret == -1) {
pr_perror("Unable to spice data");
return -1;
}
if (ret != len) {
pr_err("Only %lu of %lu bytes have been spliced\n", ret, len);
return -1;
}
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