Skip to contentSkip to conversation

rados_aio_get_return_value returning 0 on writes

DISCUSSION Christian Brunner 2 participants 2 messages May 6, 2010

lore
Share & tools
lore
#0 lore raw

Almost forgot to write this: When calling rados_aio_get_return_value on the callback of a write it is always returning 0.

I would have expected the number of bytes written (or a value <0 on error).

Qemu doesn't seem to care, so this isn't really a problem for me.

Christian

#1 lore raw
Quoted 4 lines · Christian Brunner

Almost forgot to write this: When calling rados_aio_get_return_value on the callback of a write it is always returning 0.

I would have expected the number of bytes written (or a value <0 on error).

The OSD always writes the number of bytes you gave it, or nothing at all. Since there are no "short" writes, and an osd op can be something much more complicated than a write (write this here + write that there + set this xattr + remove that xattr) there isn't necessarily a byte count, so it returns a simple 0 for success.

Quoted 1 line

Qemu doesn't seem to care, so this isn't really a problem for me.

You can also just return the size you sent to the OSD when you get a 0 back.

sage