From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/5] qcow2: Add corrupt bit
Date: Thu, 29 Aug 2013 10:57:20 +0200 [thread overview]
Message-ID: <20130829085720.GE2961@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <521F0600.9050701@redhat.com>
Am 29.08.2013 um 10:27 hat Max Reitz geschrieben:
> Am 29.08.2013 10:23, schrieb Kevin Wolf:
> >Am 28.08.2013 um 16:55 hat Max Reitz geschrieben:
> >>This adds an incompatible bit indicating corruption to qcow2. Any image
> >>with this bit set may not be written to unless for repairing (and
> >>subsequently clearing the bit if the repair has been successful).
> >>
> >>Signed-off-by: Max Reitz <mreitz@redhat.com>
> >>---
> >> block/qcow2.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
> >> block/qcow2.h | 7 ++++++-
> >> docs/specs/qcow2.txt | 7 ++++++-
> >> tests/qemu-iotests/031.out | 12 ++++++------
> >> tests/qemu-iotests/036.out | 2 +-
> >> 5 files changed, 64 insertions(+), 9 deletions(-)
> >>@@ -402,6 +433,15 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags)
> >> goto fail;
> >> }
> >>+ if (s->incompatible_features & QCOW2_INCOMPAT_CORRUPT) {
> >>+ /* Corrupt images may not be written to unless they are being repaired
> >>+ */
> >>+ if ((flags & BDRV_O_RDWR) && !(flags & BDRV_O_CHECK)) {
> >>+ ret = -EACCES;
> >Perhaps a (q)error_report() call would be appropriate so that the user
> >isn't confused with only the "Permission denied" message
> Seems reasonable.
> >(should it be
> >EPERM rather than EACCES, too? Or maybe EROFS?)
> I chose the value based on the following:
> $ touch foo
> $ chmod -w foo
> $ echo 'bar' > foo
> zsh: permission denied: foo
> (which is EACCES)
Well, the point is that when I get EACCES (i.e. a "Permission denied"
message), the first thing I do is to check the file permissions of the
image file, because that's really what EACCES says. So it's kind of
misleading.
> EROFS sounds nice, but I wouldn't go for it since it's the image
> that's read-only and not the underlying FS (which I think EROFS is
> for…?)
Unfortunately errno values are hardly ever a perfect match... I think
I'm less likely to be misled by EROFS because I _know_ that my /home (or
/var, for that matter) isn't read-only.
In the end, it's probably not all that important as long as we print a
clear (q)error_report() message in addition.
Kevin
next prev parent reply other threads:[~2013-08-29 8:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 14:55 [Qemu-devel] [PATCH v2 0/5] qcow2: Add metadata overlap checks Max Reitz
2013-08-28 14:55 ` [Qemu-devel] [PATCH v2 1/5] qcow2: Add corrupt bit Max Reitz
2013-08-29 8:23 ` Kevin Wolf
2013-08-29 8:27 ` Max Reitz
2013-08-29 8:57 ` Kevin Wolf [this message]
2013-08-28 14:55 ` [Qemu-devel] [PATCH v2 2/5] qcow2: Metadata overlap checks Max Reitz
2013-08-29 8:51 ` Kevin Wolf
2013-08-29 8:57 ` Max Reitz
2013-08-28 14:55 ` [Qemu-devel] [PATCH v2 3/5] qcow2: Employ metadata " Max Reitz
2013-08-29 9:18 ` Kevin Wolf
2013-08-29 9:20 ` Max Reitz
2013-08-28 14:55 ` [Qemu-devel] [PATCH v2 4/5] qcow2: More complete consistency check Max Reitz
2013-08-29 11:36 ` Kevin Wolf
2013-08-29 12:09 ` Max Reitz
2013-08-28 14:55 ` [Qemu-devel] [PATCH v2 5/5] qemu-iotests: Overlapping cluster allocations 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=20130829085720.GE2961@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).