[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields |
Date: |
Thu, 21 Dec 2023 06:56:11 -0500 |
On Thu, Dec 21, 2023 at 08:26:58AM +0100, Paolo Bonzini wrote:
> On 12/21/23 02:49, Stefan Hajnoczi wrote:
> > nbd_client_receive_next_request(client);
> > +
> > + qemu_mutex_unlock(&client->lock);
> > +
> > if (ret == -EIO) {
> > goto disconnect;
> > }
>
> I think I slightly prefer if disconnect is reached with lock taken, for
> consistency with the "done" label. It does not complicate the code,
> because you can just move qio_channel_set_cork() and replace:
Yes, that makes the code easier to follow. Will fix in v2.
Stefan
signature.asc
Description: PGP signature
- [PATCH 2/6] fixup block: remove AioContext locking, (continued)
- [PATCH 2/6] fixup block: remove AioContext locking, Stefan Hajnoczi, 2023/12/20
- [PATCH 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put(), Stefan Hajnoczi, 2023/12/20
- [PATCH 3/6] fixup scsi: only access SCSIDevice->requests from one thread, Stefan Hajnoczi, 2023/12/20
- [PATCH 5/6] nbd/server: only traverse NBDExport->clients from main loop thread, Stefan Hajnoczi, 2023/12/20
- [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields, Stefan Hajnoczi, 2023/12/20