Project

General

Profile

Actions

Bug #7952

closed

After aio_read() completes a call to return_value() doesn't return bytes read

Added by David Zafman about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Low
Assignee:
David Zafman
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

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().

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();
}

Related issues 1 (0 open1 closed)

Related to Ceph - Bug #7822: examples/librados/hello_world.cc broken on masterResolvedJosh Durgin03/21/2014

Actions
Actions #1

Updated by David Zafman about 10 years ago

  • Description updated (diff)
Actions #2

Updated by Dan Mick about 10 years ago

This might be the issue underlying #7822

Actions #3

Updated by David Zafman about 10 years ago

  • Status changed from New to Resolved
  • Assignee set to David Zafman

d99f1d9f68db41231e0ffff4082b05d6d095c231

I forgot about this bug report, so it wasn't specified in the commit comment.

Actions

Also available in: Atom PDF