From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Jagannathan Raman <jag.raman@oracle.com>
Cc: elena.ufimtseva@oracle.com, stefanha@gmail.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] io: error_prepend() in qio_channel_readv_full_all() causes segfault
Date: Fri, 12 Feb 2021 11:16:58 +0000 [thread overview]
Message-ID: <20210212111658.GF1340027@redhat.com> (raw)
In-Reply-To: <be476bcdb99e820fec0fa09fe8f04c9dd3e62473.1613128220.git.jag.raman@oracle.com>
On Fri, Feb 12, 2021 at 06:16:07AM -0500, Jagannathan Raman wrote:
> Using error_prepend() in qio_channel_readv_full_all() causes a segfault
> as errp is not set when ret is 0. This results in the failure of iotest
> 83. Replacing with error_setg() fixes the problem.
>
> Additionally, removes a full stop at the end of error message
>
> Reported-by: Max Reitz <mreitz@redhat.com>
> Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
> ---
> io/channel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/io/channel.c b/io/channel.c
> index 4555021..e8b019d 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -202,8 +202,7 @@ int qio_channel_readv_full_all(QIOChannel *ioc,
> int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, errp);
>
> if (ret == 0) {
> - error_prepend(errp,
> - "Unexpected end-of-file before all data were read.");
> + error_setg(errp, "Unexpected end-of-file before all data were read");
> return -1;
> }
> if (ret == 1) {
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-02-12 11:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 11:16 [PATCH] Fix segfault during NBD iotest 083 Jagannathan Raman
2021-02-12 11:16 ` [PATCH] io: error_prepend() in qio_channel_readv_full_all() causes segfault Jagannathan Raman
2021-02-12 11:16 ` Daniel P. Berrangé [this message]
2021-02-12 11:41 ` Jag Raman
2021-02-12 13:08 ` Eric Blake
2021-02-12 13:13 ` Jag Raman
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=20210212111658.GF1340027@redhat.com \
--to=berrange@redhat.com \
--cc=elena.ufimtseva@oracle.com \
--cc=jag.raman@oracle.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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).