Change aio_callback return code handling for NBD_CMD_READ command.
Tracker:
http://tracker.ceph.com/issues/15604
Signed-off-by: Chang-Yi Lee <cy.l@inwinstack.com>
(cherry picked from commit
ee211295441b126a995c07820176cfc966ab61c5)
} else if ((ctx->command == NBD_CMD_READ) &&
ret < static_cast<int>(ctx->request.len)) {
int pad_byte_count = static_cast<int> (ctx->request.len) - ret;
- ctx->data.append('\x0', pad_byte_count);
+ ctx->data.append_zero(pad_byte_count);
dout(20) << __func__ << ": " << *ctx << ": Pad byte count: "
<< pad_byte_count << dendl;
+ ctx->reply.error = 0;
} else {
ctx->reply.error = htonl(0);
}