07.05.2018 21:08, Eric Blake wrote:
On 05/07/2018 10:44 AM, Vladimir Sementsov-Ogievskiy wrote:
We have several paranoiac checks for ioc != NULL. But ioc may become
NULL only on close, which should not happen during requests handling.
Also, we check ioc only sometimes, not after each yield, which is
inconsistent. Let's drop these checks.

Can (or even should) any of these be replaced by asserts that ioc is not NULL?


Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
---
  block/nbd-client.c | 14 +-------------
  1 file changed, 1 insertion(+), 13 deletions(-)


No problem, I can add them. Actually in most of cases we will crash very soon on
next QIO_CHANNEL_GET_CLASS(ioc). The exclusions (looked through) are:

 - "if (!s->ioc || s->quit) {" case, if reply is not simple.
 - zero-length io requests in other cases, if they are possible

--
Best regards,
Vladimir


Reply via email to