You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib/ublksrv.c invokes q->tgt_ops->handle_io_async(local_to_tq(q), &io->data); but never checks the return value of handle_io_async. Looking at the code, this is the only place where handle_io_async is invoked.
The function returns an int, which could be used as a signal that target failed to submit the IO asynchronously. I'm not sure what the library should do in this case, but I think the library should do something.
The text was updated successfully, but these errors were encountered:
I think it should be fine/enough to define its return value as 'void', and the similar one could be submit_bio() in linux kernel. The benefit is one simpler
interface. Then we can just add one warn or assert() in case of non-zero return
value of ->handle_io_async()?
What do you think of this way?
Another way is to fail the current command in case of non-zero return value,
but looks it is not flexible as the above style.
I think returning void is acceptable and the option I prefer.
At first I thought the return code could be used by libublksrv to automatically call ->ublksrv_complete_io with an error result, but why not make this the responsibility of ->handle_io_async? (which is the case today). Besides, a buggy ->handle_io_async implementation could still return 0 when it shouldn't and drop an IO request. Better to document the contract that the target MUST call ->ublksrv_complete_io, even if an error occurs, for each invocation of ->handle_io_async.
lib/ublksrv.c invokes
q->tgt_ops->handle_io_async(local_to_tq(q), &io->data);
but never checks the return value ofhandle_io_async
. Looking at the code, this is the only place wherehandle_io_async
is invoked.The function returns an int, which could be used as a signal that target failed to submit the IO asynchronously. I'm not sure what the library should do in this case, but I think the library should do something.
The text was updated successfully, but these errors were encountered: