Ian Jackson
2013-Nov-12 16:49 UTC
[PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata
Ages ago, Chunyan Liu writes:> Tried the patch. It worked. Thanks.Thanks. IMO this patch should be considered for backporting, too. Ian. From 70f4755fba5e6a39e4f8ad55aff2d21f6aa8ff21 Mon Sep 17 00:00:00 2001 From: Ian Jackson <ian.jackson@eu.citrix.com> Date: Tue, 3 Sep 2013 13:41:46 +0100 Subject: [PATCH] libxl: Do not generate short block in libxl__datacopier_prefixdata libxl__datacopier_prefixdata would prepend a deliberately short block (not just a half-full one, but one with a short buffer) to the dc->bufs queue. However, this is wrong because datacopier_readable will find it and try to continue to fill it up. Instead, allocate a full-sized buffer. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Tested-by: Chunyan Liu <cyliu@suse.com> --- tools/libxl/libxl_aoutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c index 983a60a..b4eb6e5 100644 --- a/tools/libxl/libxl_aoutils.c +++ b/tools/libxl/libxl_aoutils.c @@ -89,7 +89,7 @@ void libxl__datacopier_prefixdata(libxl__egc *egc, libxl__datacopier_state *dc, assert(len < dc->maxsz - dc->used); - buf = libxl__zalloc(NOGC, sizeof(*buf) - sizeof(buf->buf) + len); + buf = libxl__zalloc(NOGC, sizeof(*buf)); buf->used = len; memcpy(buf->buf, data, len); -- 1.7.10.4
Ian Campbell
2013-Nov-12 17:23 UTC
Re: [PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata
On Tue, 2013-11-12 at 16:49 +0000, Ian Jackson wrote:> Ages ago, Chunyan Liu writes: > > Tried the patch. It worked. Thanks. > > Thanks. > > IMO this patch should be considered for backporting, too. > > Ian. > > From 70f4755fba5e6a39e4f8ad55aff2d21f6aa8ff21 Mon Sep 17 00:00:00 2001 > From: Ian Jackson <ian.jackson@eu.citrix.com> > Date: Tue, 3 Sep 2013 13:41:46 +0100 > Subject: [PATCH] libxl: Do not generate short block in > libxl__datacopier_prefixdata > > libxl__datacopier_prefixdata would prepend a deliberately short block > (not just a half-full one, but one with a short buffer) to the > dc->bufs queue. However, this is wrong because datacopier_readable > will find it and try to continue to fill it up. > > Instead, allocate a full-sized buffer. > > Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> > Tested-by: Chunyan Liu <cyliu@suse.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/libxl/libxl_aoutils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c > index 983a60a..b4eb6e5 100644 > --- a/tools/libxl/libxl_aoutils.c > +++ b/tools/libxl/libxl_aoutils.c > @@ -89,7 +89,7 @@ void libxl__datacopier_prefixdata(libxl__egc *egc, libxl__datacopier_state *dc, > > assert(len < dc->maxsz - dc->used); > > - buf = libxl__zalloc(NOGC, sizeof(*buf) - sizeof(buf->buf) + len); > + buf = libxl__zalloc(NOGC, sizeof(*buf)); > buf->used = len; > memcpy(buf->buf, data, len); >
Ian Jackson
2013-Nov-12 17:25 UTC
Re: [PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata
Ian Campbell writes ("Re: [PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata"):> On Tue, 2013-11-12 at 16:49 +0000, Ian Jackson wrote: > > From 70f4755fba5e6a39e4f8ad55aff2d21f6aa8ff21 Mon Sep 17 00:00:00 2001 > > From: Ian Jackson <ian.jackson@eu.citrix.com> > > Date: Tue, 3 Sep 2013 13:41:46 +0100 > > Subject: [PATCH] libxl: Do not generate short block in > > libxl__datacopier_prefixdata > > > > libxl__datacopier_prefixdata would prepend a deliberately short block > > (not just a half-full one, but one with a short buffer) to the > > dc->bufs queue. However, this is wrong because datacopier_readable > > will find it and try to continue to fill it up. > > > > Instead, allocate a full-sized buffer. > > > > Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> > > Tested-by: Chunyan Liu <cyliu@suse.com> > > Acked-by: Ian Campbell <ian.campbell@citrix.com>Thanks, Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> I have put it on my backport list too. Ian.
Ian Jackson
2013-Nov-25 13:56 UTC
Re: [PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata
Ian Jackson writes ("Re: [PATCH RESEND] libxl: Do not generate short block in libxl__datacopier_prefixdata"):> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> > > I have put it on my backport list too.Now applied to 4.3, 4.2. Was not applicable to 4.1. Ian.
Seemingly Similar Threads
- Remus: Xen 4.2.1 with Debian 6.0 does not work
- Remus: Xen 4.2.1 with Debian 6.0 does not work
- [xen-4.3-testing test] 22107: regressions - trouble: blocked/broken/fail/pass
- [xen-4.3-testing test] 22144: regressions - FAIL
- xl create PV guest with qcow/qcow2 disk images fail