* [PATCH] nbd: Drop dead code spotted by Coverity
@ 2022-05-16 21:05 Eric Blake
2022-05-17 7:37 ` Peter Maydell
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eric Blake @ 2022-05-16 21:05 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Vladimir Sementsov-Ogievskiy, Kevin Wolf,
Hanna Reitz, open list:Network Block Dev...
CID 1488362 points out that the second 'rc >= 0' check is now dead
code.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 172f5f1a40(nbd: remove peppering of nbd_client_connected)
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/nbd.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 6085ab1d2c..7f5f50ec46 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -521,12 +521,8 @@ static int coroutine_fn nbd_co_send_request(BlockDriverState *bs,
if (qiov) {
qio_channel_set_cork(s->ioc, true);
rc = nbd_send_request(s->ioc, request);
- if (rc >= 0) {
- if (qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov,
- NULL) < 0) {
- rc = -EIO;
- }
- } else if (rc >= 0) {
+ if (rc >= 0 && qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov,
+ NULL) < 0) {
rc = -EIO;
}
qio_channel_set_cork(s->ioc, false);
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nbd: Drop dead code spotted by Coverity
2022-05-16 21:05 [PATCH] nbd: Drop dead code spotted by Coverity Eric Blake
@ 2022-05-17 7:37 ` Peter Maydell
2022-05-17 9:17 ` Vladimir Sementsov-Ogievskiy
2022-05-30 13:22 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2022-05-17 7:37 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz,
open list:Network Block Dev...
On Mon, 16 May 2022 at 22:05, Eric Blake <eblake@redhat.com> wrote:
>
> CID 1488362 points out that the second 'rc >= 0' check is now dead
> code.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: 172f5f1a40(nbd: remove peppering of nbd_client_connected)
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block/nbd.c | 8 ++------
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nbd: Drop dead code spotted by Coverity
2022-05-16 21:05 [PATCH] nbd: Drop dead code spotted by Coverity Eric Blake
2022-05-17 7:37 ` Peter Maydell
@ 2022-05-17 9:17 ` Vladimir Sementsov-Ogievskiy
2022-05-30 13:22 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2022-05-17 9:17 UTC (permalink / raw)
To: Eric Blake, qemu-devel
Cc: Peter Maydell, Kevin Wolf, Hanna Reitz,
open list:Network Block Dev...
17.05.2022 00:05, Eric Blake wrote:
> CID 1488362 points out that the second 'rc >= 0' check is now dead
> code.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: 172f5f1a40(nbd: remove peppering of nbd_client_connected)
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block/nbd.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/block/nbd.c b/block/nbd.c
> index 6085ab1d2c..7f5f50ec46 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -521,12 +521,8 @@ static int coroutine_fn nbd_co_send_request(BlockDriverState *bs,
> if (qiov) {
> qio_channel_set_cork(s->ioc, true);
> rc = nbd_send_request(s->ioc, request);
> - if (rc >= 0) {
> - if (qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov,
> - NULL) < 0) {
> - rc = -EIO;
> - }
> - } else if (rc >= 0) {
> + if (rc >= 0 && qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov,
> + NULL) < 0) {
> rc = -EIO;
> }
> qio_channel_set_cork(s->ioc, false);
Hi all! I am back). And happy to start with something simple:
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
(yes, not @openvz.org, just my personal address. Probably new employer will ask to use a corporate one, if so I'll have to send one another patch to MAINTAINERS. But I'd prefer not to hurry with it.)
Sorry for a long delay. That was a gap between old place of work and a new one. I have planned to do some review and resending work in the list during the gap, but.. There were so many things)
Anyway, now at new work I've given some time to continue Qemu maintenance and working on my unfinished series and that's wonderful.
--
Best regards,
Vladimir
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nbd: Drop dead code spotted by Coverity
2022-05-16 21:05 [PATCH] nbd: Drop dead code spotted by Coverity Eric Blake
2022-05-17 7:37 ` Peter Maydell
2022-05-17 9:17 ` Vladimir Sementsov-Ogievskiy
@ 2022-05-30 13:22 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2022-05-30 13:22 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, Peter Maydell, Vladimir Sementsov-Ogievskiy,
Hanna Reitz, open list:Network Block Dev...
Am 16.05.2022 um 23:05 hat Eric Blake geschrieben:
> CID 1488362 points out that the second 'rc >= 0' check is now dead
> code.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: 172f5f1a40(nbd: remove peppering of nbd_client_connected)
> Signed-off-by: Eric Blake <eblake@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-30 13:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-16 21:05 [PATCH] nbd: Drop dead code spotted by Coverity Eric Blake
2022-05-17 7:37 ` Peter Maydell
2022-05-17 9:17 ` Vladimir Sementsov-Ogievskiy
2022-05-30 13:22 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).