Skip to content

Commit

Permalink
rbd-nbd: Fix aio_callback error handling
Browse files Browse the repository at this point in the history
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 ee21129)
  • Loading branch information
cy.l@inwinstack.com authored and Jason Dillaman committed May 9, 2016
1 parent 4e87c1c commit c1960de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/rbd_nbd/rbd-nbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@ class NBDServer
} 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);
}
Expand Down

0 comments on commit c1960de

Please sign in to comment.