From: Dario Faggioli <dario.faggioli@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
Harmandeep Kaur <write.harmandeep@gmail.com>
Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2] libxl: fix handling of returns in libxl_get_version_info()
Date: Fri, 12 Feb 2016 14:09:28 +0100 [thread overview]
Message-ID: <1455282568.3148.356.camel@citrix.com> (raw)
In-Reply-To: <20160212123145.GA3036@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 1766 bytes --]
On Fri, 2016-02-12 at 12:31 +0000, Wei Liu wrote:
> On Fri, Feb 12, 2016 at 05:00:40PM +0530, Harmandeep Kaur wrote:
> >
> > + info->xen_version_major = r >> 16;
> > + info->xen_version_minor = r & 0xFF;
> >
> > - xc_version(ctx->xch, XENVER_extraversion, &u.xen_extra);
> > + r = xc_version(ctx->xch, XENVER_extraversion, &u.xen_extra);
> > + if ( r < 0 ) goto out;
> > info->xen_version_extra = libxl__strdup(NOGC, u.xen_extra);
> >
> > - xc_version(ctx->xch, XENVER_compile_info, &u.xen_cc);
> > + r = xc_version(ctx->xch, XENVER_compile_info, &u.xen_cc);
> > + if ( r < 0 ) goto out;
>
> At the beginning of this function it checks if info-
> >xen_version_extra
> is not NULL.
>
> You can now get into a state where partial information is cached.
> This
> is buggy.
>
Yep, I saw this, and figured out it is not ideal. I thought that, as
you say, original code was bad in this respect already, and that we
should fix that independently. However...
> Not that the original implementation is any better, but if you're
> going
> to fix it, try not to introduce new bug with your fix. :-)
>
> I think you can rollback the caching by freeing up any resources
> before
> returning.
>
...you're right, it's probably simple enough to fix both issues, that
we should just take the chance.
So, Harmandeep, can you take care of this issue Wei is rising as well?
Thanks and Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-02-12 13:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 11:30 [PATCH v2] libxl: fix handling of returns in libxl_get_version_info() Harmandeep Kaur
2016-02-12 12:31 ` Wei Liu
2016-02-12 13:09 ` Dario Faggioli [this message]
2016-02-12 20:37 ` Harmandeep Kaur
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=1455282568.3148.356.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=write.harmandeep@gmail.com \
--cc=xen-devel@lists.xenproject.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).