From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [PULL v2 18/20] nbd: Drop dead code spotted by Coverity
Date: Fri, 24 Jun 2022 17:41:01 +0200 [thread overview]
Message-ID: <20220624154103.185902-19-kwolf@redhat.com> (raw)
In-Reply-To: <20220624154103.185902-1-kwolf@redhat.com>
From: Eric Blake <eblake@redhat.com>
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>
Message-Id: <20220516210519.76135-1-eblake@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
Signed-off-by: Kevin Wolf <kwolf@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.35.3
next prev parent reply other threads:[~2022-06-24 16:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 15:40 [PULL v2 00/20] Block layer patches Kevin Wolf
2022-06-24 15:40 ` [PULL v2 01/20] block: drop unused bdrv_co_drain() API Kevin Wolf
2022-06-24 15:40 ` [PULL v2 02/20] block: get rid of blk->guest_block_size Kevin Wolf
2022-06-24 15:40 ` [PULL v2 03/20] block: block_dirty_bitmap_merge(): fix error path Kevin Wolf
2022-06-24 15:40 ` [PULL v2 04/20] block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap Kevin Wolf
2022-06-24 15:40 ` [PULL v2 05/20] block: simplify handling of try to merge different sized bitmaps Kevin Wolf
2022-06-24 15:40 ` [PULL v2 06/20] block: Support passing NULL ops to blk_set_dev_ops() Kevin Wolf
2022-06-24 15:40 ` [PULL v2 07/20] block/export: Fix incorrect length passed to vu_queue_push() Kevin Wolf
2022-06-24 15:40 ` [PULL v2 08/20] block/export: Abstract out the logic of virtio-blk I/O process Kevin Wolf
2022-06-24 15:40 ` [PULL v2 09/20] linux-headers: Add vduse.h Kevin Wolf
2022-06-24 15:40 ` [PULL v2 10/20] libvduse: Add VDUSE (vDPA Device in Userspace) library Kevin Wolf
2022-06-27 4:45 ` Markus Armbruster
2022-06-27 8:34 ` Yongji Xie
2022-06-24 15:40 ` [PULL v2 11/20] vduse-blk: Implement vduse-blk export Kevin Wolf
2022-06-24 15:40 ` [PULL v2 12/20] vduse-blk: Add vduse-blk resize support Kevin Wolf
2022-06-24 15:40 ` [PULL v2 13/20] libvduse: Add support for reconnecting Kevin Wolf
2022-06-24 15:40 ` [PULL v2 14/20] qsd: document vduse-blk exports Kevin Wolf
2022-06-24 15:40 ` [PULL v2 15/20] block/rbd: report a better error when namespace does not exist Kevin Wolf
2022-06-24 15:40 ` [PULL v2 16/20] block/gluster: correctly set max_pdiscard Kevin Wolf
2022-06-24 15:41 ` [PULL v2 17/20] aio_wait_kick: add missing memory barrier Kevin Wolf
2022-06-24 15:41 ` Kevin Wolf [this message]
2022-06-24 15:41 ` [PULL v2 19/20] vduse-blk: Add serial option Kevin Wolf
2022-06-24 15:41 ` [PULL v2 20/20] vduse-blk: Add name option Kevin Wolf
2022-06-24 20:38 ` [PULL v2 00/20] Block layer patches Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220624154103.185902-19-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).