Bug #7952
Updated by David Zafman about 10 years ago
When using the rados_aio_read() interface the c.bl bufferlist stores the read data. So the code below will set rval = c.bl.length(). The aio_read() gets a user bufferlist passed in, so return_value() returns 0 on success. This is just a confusing behavior which should be consistent between rados_return_value() and ctx.return_value(). <pre> void librados::IoCtxImpl::C_aio_Ack::finish(int r) { c->lock.Lock(); c->rval = r; c->ack = true; if (c->is_read) c->safe = true; c->cond.Signal(); if (c->bl.length() > 0) { c->rval = c->bl.length(); } if (c->callback_complete) { c->io->client->finisher.queue(new C_AioComplete(c)); } if (c->is_read && c->callback_safe) { c->io->client->finisher.queue(new C_AioSafe(c)); } c->put_unlock(); } </pre>