]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-nbd: returned length equal requested only for read and write
authorMykola Golub <mgolub@mirantis.com>
Wed, 13 Jan 2016 10:42:47 +0000 (12:42 +0200)
committerMykola Golub <mgolub@mirantis.com>
Wed, 13 Jan 2016 11:07:36 +0000 (13:07 +0200)
On success aio_discard returns 0.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/tools/rbd_nbd/rbd-nbd.cc

index 07d7edb19c634f47601fd6c3590441495db07945..04a935aa97236b96c6365c33a49cd2cdff44e1a5 100644 (file)
@@ -186,7 +186,8 @@ private:
 
     if (ret < 0) {
       ctx->reply.error = htonl(-ret);
-    } else if (ret != static_cast<int>(ctx->request.len)) {
+    } else if ((ctx->command == NBD_CMD_WRITE || ctx->command == NBD_CMD_READ)
+              && ret != static_cast<int>(ctx->request.len)) {
       derr << __func__ << ": " << *ctx << ": unexpected return value: " << ret
           << " (" << ctx->request.len << " expected)" << dendl;
       ctx->reply.error = htonl(EIO);