On 05/13/2014 10:02 AM, Markus Armbruster wrote: > Cc: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp> > Signed-off-by: Markus Armbruster <arm...@redhat.com> > --- > block/sheepdog.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) > > @@ -1568,13 +1565,15 @@ static int sd_prealloc(const char *filename) > */ > ret = bdrv_pread(bs, idx * SD_DATA_OBJ_SIZE, buf, SD_DATA_OBJ_SIZE); > if (ret < 0) { > - goto out; > + goto out_setg; > } > ret = bdrv_pwrite(bs, idx * SD_DATA_OBJ_SIZE, buf, SD_DATA_OBJ_SIZE); > if (ret < 0) { > - goto out; > + goto out_setg; > } > } > +out_setg: > + error_setg_errno(errp, -ret, "Can't pre-allocate");
This unconditionally sets errp even when the for loop completes normally. Are you sure you want this control flow? Maybe you are missing a 'goto out' prior to the 'out_setg' label? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature