qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: phoeagon <phoeagon@gmail.com>, Max Reitz <mreitz@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] use bdrv_flush to provide barrier semantic in block/vdi.c for metadata updates
Date: Wed, 06 May 2015 11:28:20 -0600	[thread overview]
Message-ID: <554A4F34.4080505@redhat.com> (raw)
In-Reply-To: <CAKYApDBpL9GiLf7A0E6sff1H6zUgEmE9-pF=mndZjJiBCUpfGQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2692 bytes --]

On 05/06/2015 11:23 AM, phoeagon wrote:
> Thanks for your input.
> 
> So I changed it to:
> 1. Only call bdrv_flush when bdrv_pwrite was successful
> 2. Only if bdrv_flush was unsuccessful that the return value of
> vdi_co_write is updated.
> In this way we try to avoid messing up any potential return value checks
> possible while still propagating bdrv_flush errors.
> That return value was a catch and I admit I'm no pro with the return value
> convention in QEMU. bdrv_pwrite doesn't return the same value as
> bdrv_pwrite_sync I assume (they do return negative values when fail, but
> different values when successful)
> ---
> 

The text above [1]...

> 
> Signed-off-by: Zhe Qiu <address@hidden>

This S-o-b is still broken.

> 
>>From 19b2fabbe00765b418362d8c1891f266091621f3 Mon Sep 17 00:00:00 2001

When sending a revised patch, it's better to send it as a new top-level
thread, and with 'v2' somewhere in the subject line (hint: git
send-email -v2).  Your placement of the Signed-off-by line before the
From: attribution line is incorrect

> From: phoeagon <address-hidden>
> Date: Thu, 7 May 2015 01:09:38 +0800
> Subject: [PATCH] block/vdi: Use bdrv_flush after metadata updates
> 
> In reference to
> b0ad5a455d7e5352d4c86ba945112011dbeadfb8~078a458e077d6b0db262c4b05fee51d01de2d1d2,
> metadata writes to qcow2/cow/qcow/vpc/vmdk are all synced prior to
> succeeding writes.
> 
> ---

...[1] is more useful here, after the commit message body.

I highly suggest you read http://wiki.qemu.org/Contribute/SubmitAPatch;
it is also a good idea to use 'git send-email' to send a patch to
yourself, then 'git am' on that message to see if it survived the round
trip through email, before sending to the list.

>  block/vdi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/block/vdi.c b/block/vdi.c
> index 5d09b36..54a5fa8 100644
> --- a/block/vdi.c
> +++ b/block/vdi.c
> @@ -713,7 +713,11 @@ static int vdi_co_write(BlockDriverState *bs,
>          logout("will write %u block map sectors starting from entry %u\n",
>                 n_sectors, bmap_first);
>          ret = bdrv_write(bs->file, offset, base, n_sectors);
> +        if (!(ret < 0)) {

This looks odd.  Better might be: 'if (ret >= 0) {'

> +            int flush_ret = bdrv_flush(bs->file);
> +            if (flush_ret < 0)
> +                ret = flush_ret;

Missing {} (hint: scripts/checkpatch.pl is an important part of good
patch submission)

> +        }
>      }
> 
>      return ret;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-05-06 17:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01 15:03 [Qemu-devel] [PATCH] use bdrv_flush to provide barrier semantic in block/vdi.c for metadata updates phoeagon
2015-05-06 16:42 ` Max Reitz
2015-05-06 17:23   ` phoeagon
2015-05-06 17:28     ` Eric Blake [this message]
2015-05-06 17:36     ` Max Reitz

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=554A4F34.4080505@redhat.com \
    --to=eblake@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=phoeagon@gmail.com \
    --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).