From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code
Date: Thu, 27 Oct 2011 10:23:48 +0200 [thread overview]
Message-ID: <4EA91514.5020709@redhat.com> (raw)
In-Reply-To: <20111027073712.GE32287@stefanha-thinkpad.localdomain>
Am 27.10.2011 09:37, schrieb Stefan Hajnoczi:
> On Wed, Oct 26, 2011 at 02:31:16PM +0200, Kevin Wolf wrote:
>> @@ -2039,11 +2039,7 @@ const char *bdrv_get_encrypted_filename(BlockDriverState *bs)
>> void bdrv_get_backing_filename(BlockDriverState *bs,
>> char *filename, int filename_size)
>> {
>> - if (!bs->backing_file) {
>> - pstrcpy(filename, filename_size, "");
>> - } else {
>> - pstrcpy(filename, filename_size, bs->backing_file);
>> - }
>> + pstrcpy(filename, filename_size, bs->backing_file);
>> }
>
> I think this points to another problem:
>
> bs->backing_file[] is never cleared across bdrv_close()/bdrv_open().
>
> If we open an image file that uses a backing file, then close the
> BlockDriverState, and then open a file which does not use a backing file
> we're left with the old backing file!
Ouch! Care to send a fix?
Did you check if there are more fields in BlockDriverState that should
be cleared?
Kevin
next prev parent reply other threads:[~2011-10-27 8:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 12:31 [Qemu-devel] [PATCH 0/7] block: Collection of unrelated simple fixes Kevin Wolf
2011-10-26 12:31 ` [Qemu-devel] [PATCH 1/7] block: Remove dead code Kevin Wolf
2011-10-27 1:50 ` Robert Wang
2011-10-27 7:37 ` Stefan Hajnoczi
2011-10-27 8:23 ` Kevin Wolf [this message]
2011-10-26 12:31 ` [Qemu-devel] [PATCH 2/7] block: Fix bdrv_open use after free Kevin Wolf
2011-10-26 12:31 ` [Qemu-devel] [PATCH 3/7] qcow: Fix bdrv_write_compressed error handling Kevin Wolf
2011-10-27 7:33 ` Paolo Bonzini
2011-10-26 12:31 ` [Qemu-devel] [PATCH 4/7] ide: Fix off-by-one error in array index check Kevin Wolf
2011-10-27 7:32 ` Paolo Bonzini
2011-10-26 12:31 ` [Qemu-devel] [PATCH 5/7] vmdk: Fix use of uninitialised value Kevin Wolf
2011-10-26 13:21 ` Pavel Borzenkov
2011-10-26 13:50 ` Kevin Wolf
2011-10-26 12:31 ` [Qemu-devel] [PATCH 6/7] vmdk: Improve error handling Kevin Wolf
2011-10-26 12:31 ` [Qemu-devel] [PATCH 7/7] vmdk: Fix possible segfaults Kevin Wolf
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=4EA91514.5020709@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 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).