Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thread: send message for completion with no channels
When spdk_for_each_channel() was called on an io_device with no channels, the completion function would be called immediately in the context of the spdk_for_each_channel() caller. This is different than the normal completion when channels are present, which is always called asynchronously via spdk_thread_send_msg(), causing problems for callers that did not expect to get the completion callback before for_each_channel returned. In particular, this causes problems with the set_bdev_qos_limit_iops RPC method, which holds a mutex around the spdk_for_each_channel() call and also attempts to lock that mutex again within the completion callback. (This is GitHub issue spdk#344.) To avoid this problem and make the completion call consistent between no-channels and channels-present cases, always send the completion via spdk_thread_send_msg(). Change-Id: I9e5ec3592462c7b2ed682e665fe62ae3a5b5cc59 Signed-off-by: Daniel Verkamp <[email protected]> Reviewed-on: https://review.gerrithub.io/417068 Tested-by: SPDK Automated Test System <[email protected]> Reviewed-by: Shuhei Matsumoto <[email protected]> Reviewed-by: Ben Walker <[email protected]>
- Loading branch information