[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 for-7.1 1/9] nbd: safeguard against waking up invalid coro
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 for-7.1 1/9] nbd: safeguard against waking up invalid coroutine |
Date: |
Thu, 14 Apr 2022 14:02:31 -0500 |
User-agent: |
NeoMutt/20211029-34-be16c3 |
On Thu, Apr 14, 2022 at 07:57:48PM +0200, Paolo Bonzini wrote:
> The .reply_possible field of s->requests is never set to false. This is
> not a problem as it is only a safeguard to detect protocol errors,
> but it's sloppy. In fact, the field is actually not necessary at all,
> because .coroutine is set to NULL in NBD_FOREACH_REPLY_CHUNK after
> receiving the last chunk. Thus, replace .reply_possible with .coroutine
> and move the check before deciding the fate of this request.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/nbd.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
Ah, indeed nicer than the v1 approach.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org