]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-nbd: Fix aio_callback error handling 9005/head
authorcy.l@inwinstack.com <cy.l@inwinstack.com>
Sat, 30 Apr 2016 07:22:29 +0000 (15:22 +0800)
committerJason Dillaman <dillaman@redhat.com>
Mon, 9 May 2016 17:19:13 +0000 (13:19 -0400)
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)

src/tools/rbd_nbd/rbd-nbd.cc

index 60192b07eaf3ea235dbb29fba19b61eaa4b7311c..f7e7531755851ef7ff1700f121361ecbebb3e6c1 100644 (file)
@@ -189,9 +189,10 @@ private:
     } 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);
     }