All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: josh.durgin@dreamhost.com, morita.kazutaka@gmail.com,
	tailai.ly@taobao.com, rjones@redhat.com, qemu-devel@nongnu.org,
	stefanha@redhat.com, bharata@linux.vnet.ibm.com, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block: change default of .has_zero_init to 0
Date: Fri, 28 Jun 2013 12:21:02 +0200	[thread overview]
Message-ID: <51CD638E.20902@kamp.de> (raw)
In-Reply-To: <20130628080644.GA3095@dhcp-200-207.str.redhat.com>

On 28.06.2013 10:06, Kevin Wolf wrote:
> Am 27.06.2013 um 15:52 hat Peter Lieven geschrieben:
>> .has_zero_init defaults to 1 for all formats and protocols.
>>
>> this is a dangerous default since this means that all
>> new added drivers need to manually overwrite it to 0 if
>> they do not ensure that a device is zero initialized
>> after bdrv_create().
>>
>> if a driver needs to explicitly set this value to
>> 1 its easier to verify the correctness in the review process.
>>
>> during review of the existing drivers it turned out
>> that ssh and gluster had a wrong default of 1.
>> both protocols support host_devices as backend
>> which are not by default zero initialized. this
>> wrong assumption will lead to possible corruption
>> if qemu-img convert is used to write to such a backend.
>>
>> a similar problem with the wrong default existed for
>> iscsi mose likely because the driver developer did
>> oversee the default value of 1.
>>
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
>>   block.c               |    8 +++++++-
>>   block/qcow.c          |    1 +
>>   block/qcow2.c         |    1 +
>>   block/qed.c           |    1 +
>>   block/raw-posix.c     |   10 +---------
>>   block/raw-win32.c     |    7 +------
>>   block/rbd.c           |    1 +
>>   block/sheepdog.c      |    1 +
>>   block/vdi.c           |    1 +
>>   block/vmdk.c          |    1 +
>>   include/block/block.h |    1 +
>>   11 files changed, 17 insertions(+), 16 deletions(-)
> You forgot cow, which is also a simple case that can be handled in this
> patch.
Do we need to check the return value of bdrv_has_zero_init(bs->backing_hd)
in case bs-backing_hd != NULL?

      parent reply	other threads:[~2013-06-28 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 13:52 [Qemu-devel] [PATCH] block: change default of .has_zero_init to 0 Peter Lieven
2013-06-27 14:53 ` Richard W.M. Jones
2013-06-27 15:12 ` Eric Blake
2013-06-28  8:06 ` Kevin Wolf
2013-06-28  8:16   ` Peter Lieven
2013-06-28  8:20     ` Kevin Wolf
2013-06-28  8:25       ` Peter Lieven
2013-06-28 10:09         ` Kevin Wolf
2013-06-28 10:11           ` Peter Lieven
2013-06-28 10:21   ` Peter Lieven [this message]

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=51CD638E.20902@kamp.de \
    --to=pl@kamp.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=famz@redhat.com \
    --cc=josh.durgin@dreamhost.com \
    --cc=kwolf@redhat.com \
    --cc=morita.kazutaka@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=tailai.ly@taobao.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.