From: cy.l@inwinstack.com Date: Sat, 30 Apr 2016 07:22:29 +0000 (+0800) Subject: rbd-nbd: Fix aio_callback error handling X-Git-Tag: v10.2.1~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1960debf5c8696f365cd670dedeea01d2a3b9a8;p=ceph.git rbd-nbd: Fix aio_callback error handling Change aio_callback return code handling for NBD_CMD_READ command. Tracker: http://tracker.ceph.com/issues/15604 Signed-off-by: Chang-Yi Lee (cherry picked from commit ee211295441b126a995c07820176cfc966ab61c5) --- diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index 60192b07eaf3..f7e753175585 100644 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@ -189,9 +189,10 @@ private: } else if ((ctx->command == NBD_CMD_READ) && ret < static_cast(ctx->request.len)) { int pad_byte_count = static_cast (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); }