From: Wido den Hollander Date: Wed, 10 Oct 2018 23:04:52 +0000 (+0200) Subject: librados: Copy buffer on AIO read X-Git-Tag: 3.2-0~50^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a624ead77a34f13d8df09ea268ccad672bdbb14;p=ceph-ci.git librados: Copy buffer on AIO read Fixes: https://tracker.ceph.com/issues/36345 Signed-off-by: Wido den Hollander --- diff --git a/src/librados/IoCtxImpl.cc b/src/librados/IoCtxImpl.cc index cd93c44a952..502972ef8cf 100644 --- a/src/librados/IoCtxImpl.cc +++ b/src/librados/IoCtxImpl.cc @@ -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(); } }