aio_exec returns ERANGE if provided buffer is not enough.
Fixes: https://tracker.ceph.com/issues/23964
Signed-off-by: Aleksei Gutikov <aleksey.gutikov@synesis.ru>
(cherry picked from commit
2ac2592e1d5548b40f7311840360968040614208)
c->cond.Signal();
if (r == 0 && c->blp && c->blp->length() > 0) {
- 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();
+ if (c->out_buf && !c->blp->is_contiguous()) {
+ c->rval = -ERANGE;
+ } else {
+ c->rval = c->blp->length();
+ }
}
if (c->callback_complete ||