From: Stefan Hajnoczi <stefanha@gmail.com>
To: lijun <junmuzi@gmail.com>
Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] HMP: snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same file
Date: Mon, 18 Nov 2013 14:31:33 +0100 [thread overview]
Message-ID: <20131118133133.GB31173@stefanha-thinkpad.hitronhub.home> (raw)
In-Reply-To: <52865824.7070600@redhat.com>
On Fri, Nov 15, 2013 at 10:21:40AM -0700, Eric Blake wrote:
> On 11/15/2013 09:42 AM, Max Reitz wrote:
>
> > Actually, the same problem can occur anyway if you have a path with a
> > couple of “.” and “..” in it – or even just a hardlink. Thus, to be
> > completely safe, we'd have to check whether the snapshot file (if it
> > already exists) has a different inode number and/or is located on a
> > different filesystem.
>
> See also the recent thread on detecting backing file loops - this should
> be part of that solution (if it isn't already):
> https://lists.gnu.org/archive/html/qemu-devel/2013-11/msg01840.html
>
>
> Backing file loops might get away with string-only detection; but then I
> start to worry that the string-only detection will misbehave on relative
> paths (consider: /dir1/a <- /dir1/b [backed by relative 'a'] <- /dir2/a
> [backed by absolute /dir1/b] <- /dir2/a [backed by relative 'a']);
> devno/inode pairs are the only reliable to detect loops when only the
> filesystem is involved, but then you also introduce network protocols
> (and there, it's worse: gluster://host1/vol/img and
> gluster://host2/vol/img could be the same file, if host1 and host2 are
> part of the same storage cluster, but there is no devno/inode to tell
> you that).
Detecting identical "files" is not a problem that can be solved in the
general case. Once network storage comes into play we don't have the
ability to check file identity.
Users can misconfigure QEMU if they try hard enough. Filename string
manipulation is very error-prone and I'd rather just avoid it than
provide a false sense of security.
What's the real use case for this patch?
Stefan
next prev parent reply other threads:[~2013-11-18 13:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 16:31 [Qemu-devel] [PATCH] HMP: snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same file lijun
2013-11-15 16:42 ` Max Reitz
2013-11-15 17:21 ` Eric Blake
2013-11-18 13:31 ` Stefan Hajnoczi [this message]
2013-12-09 6:06 ` jun muzi
2013-12-09 12:17 ` Stefan Hajnoczi
2013-12-10 13:58 ` lijun
2014-01-02 8:55 ` Stefan Hajnoczi
2014-01-02 13:06 ` Eric Blake
-- strict thread matches above, loose matches on Subject: below --
2013-11-15 16:22 lijun
2013-11-15 16:55 ` Eric Blake
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=20131118133133.GB31173@stefanha-thinkpad.hitronhub.home \
--to=stefanha@gmail.com \
--cc=junmuzi@gmail.com \
--cc=lcapitulino@redhat.com \
--cc=mreitz@redhat.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).