]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librados: Copy buffer on AIO read
authorWido den Hollander <wido@42on.com>
Wed, 10 Oct 2018 23:04:52 +0000 (01:04 +0200)
committerWido den Hollander <wido@42on.com>
Wed, 10 Oct 2018 23:04:52 +0000 (01:04 +0200)
Fixes: https://tracker.ceph.com/issues/36345
Signed-off-by: Wido den Hollander <wido@42on.com>
src/librados/IoCtxImpl.cc

index cd93c44a9528f1fd7c594205be9e5f5f3ac88c51..502972ef8cf58dbc7f38415fc13491b1cea6846a 100644 (file)
@@ -1994,6 +1994,9 @@ void librados::IoCtxImpl::C_aio_Complete::finish(int r)
     if (c->out_buf && !c->blp->is_contiguous()) {
       c->rval = -ERANGE;
     } else {
+      if (c->out_buf && !c->blp->is_provided_buffer(c->out_buf))
+        c->blp->copy(0, c->blp->length(), c->out_buf);
+
       c->rval = c->blp->length();
     }
   }