From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel <qemu-devel@nongnu.org>,
qemu block <qemu-block@nongnu.org>
Subject: Re: backing chain & block status & filters
Date: Tue, 28 Apr 2020 13:28:53 +0200 [thread overview]
Message-ID: <20200428112853.GC5789@linux.fritz.box> (raw)
In-Reply-To: <20e6c43f-c1a7-57db-58b9-3cb70f0e637f@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2434 bytes --]
Am 28.04.2020 um 13:08 hat Max Reitz geschrieben:
> On 28.04.20 10:55, Vladimir Sementsov-Ogievskiy wrote:
> > Hi!
> >
> > I wanted to resend my "[PATCH 0/4] fix & merge block_status_above and
> > is_allocated_above", and returned to all the inconsistencies about
> > block-status. I keep in mind Max's series about child-access functions,
> > and Andrey's work about using COR filter in block-stream, which depends
> > on Max's series (because, without them COR fitler with file child breaks
> > backing chains).. And, it seems that it's better to discuss some
> > questions before resending.
> >
> > First, problems about block-status:
> >
> > 1. We consider ALLOCATED = ZERO | DATA, and documented as follows:
> >
> > * BDRV_BLOCK_DATA: allocation for data at offset is tied to this layer
> > * BDRV_BLOCK_ZERO: offset reads as zero
> > * BDRV_BLOCK_OFFSET_VALID: an associated offset exists for accessing
> > raw data
> > * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this
> > * layer rather than any backing, set by block
> > layer
> >
> > This actually means, that we should always have BDRV_BLOCK_ALLOCATED for
> > formats which doesn't support backing. So, all such format drivers must
> > return ZERO or DATA (or both?), yes?. Seems file-posix does so, but, for
> > example, iscsi - doesn't.
>
> Hm. I could imagine that there are formats that have non-zero holes
> (e.g. 0xff or just garbage). It would be a bit wrong for them to return
> ZERO or DATA then.
>
> But OTOH we don’t care about such cases, do we? We need to know whether
> ranges are zero, data, or unallocated. If they aren’t zero, we only
> care about whether reading from it will return data from this layer or not.
>
> So I suppose that anything that doesn’t support backing files (or
> filtered children) should always return ZERO and/or DATA.
I'm not sure I agree with the notion that everything should be
BDRV_BLOCK_ALLOCATED at the lowest layer. It's not what it means today
at least. If we want to change this, we will have to check all callers
of bdrv_is_allocated() and friends who might use this to find holes in
the file.
Basically, the way bdrv_is_allocated() works today is that we assume an
implicit zeroed backing layer even for block drivers that don't support
backing files.
Kevin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-04-28 11:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 8:55 backing chain & block status & filters Vladimir Sementsov-Ogievskiy
2020-04-28 11:08 ` Max Reitz
2020-04-28 11:28 ` Kevin Wolf [this message]
2020-04-28 15:13 ` Vladimir Sementsov-Ogievskiy
2020-04-28 16:18 ` Eric Blake
2020-04-28 16:46 ` Vladimir Sementsov-Ogievskiy
2020-04-28 18:37 ` Kevin Wolf
2020-04-28 19:44 ` Vladimir Sementsov-Ogievskiy
2020-04-29 9:15 ` Vladimir Sementsov-Ogievskiy
2020-04-29 10:50 ` Vladimir Sementsov-Ogievskiy
2020-04-28 14:51 ` Vladimir Sementsov-Ogievskiy
2020-04-30 19:12 ` Vladimir Sementsov-Ogievskiy
2020-05-01 3:04 ` Andrey Shinkevich
2020-05-06 5:56 ` Vladimir Sementsov-Ogievskiy
2020-05-07 12:58 ` Max Reitz
2020-05-07 19:34 ` Vladimir Sementsov-Ogievskiy
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=20200428112853.GC5789@linux.fritz.box \
--to=kwolf@redhat.com \
--cc=andrey.shinkevich@virtuozzo.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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.