From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: wudxw@linux.vnet.ibm.com, tomoki.sekiyama@hds.com, aliguori@amazon.com
Subject: [Qemu-devel] [PATCH 1/3] qemu-ga: execute fsfreeze-freeze in reverse order of mounts
Date: Thu, 10 Oct 2013 15:09:40 -0500 [thread overview]
Message-ID: <1381435782-25524-2-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1381435782-25524-1-git-send-email-mdroth@linux.vnet.ibm.com>
From: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Currently, fsfreeze-freeze may cause deadlock if a guest has loopback mounts
of image files in its disk; e.g.:
# mount | grep ^/
/dev/vda1 / type ext4 (rw,noatime,seclabel,data=ordered)
/tmp/disk.img on /mnt type ext4 (rw,relatime,seclabel)
To avoid the deadlock, this freezes filesystems in reverse order of mounts.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
*fix up commit msg
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qga/commands-posix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index e199738..f453132 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -566,7 +566,7 @@ typedef struct FsMount {
QTAILQ_ENTRY(FsMount) next;
} FsMount;
-typedef QTAILQ_HEAD(, FsMount) FsMountList;
+typedef QTAILQ_HEAD(FsMountList, FsMount) FsMountList;
static void free_fs_mount_list(FsMountList *mounts)
{
@@ -728,7 +728,7 @@ int64_t qmp_guest_fsfreeze_freeze(Error **err)
/* cannot risk guest agent blocking itself on a write in this state */
ga_set_frozen(ga_state);
- QTAILQ_FOREACH(mount, &mounts, next) {
+ QTAILQ_FOREACH_REVERSE(mount, &mounts, FsMountList, next) {
fd = qemu_open(mount->dirname, O_RDONLY);
if (fd == -1) {
error_setg_errno(err, errno, "failed to open %s", mount->dirname);
--
1.7.9.5
next prev parent reply other threads:[~2013-10-10 20:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 20:09 [Qemu-devel] [PULL 0/3] qemu-ga: fsfreeze fix and guest-info extensions Michael Roth
2013-10-10 20:09 ` Michael Roth [this message]
2013-10-10 20:09 ` [Qemu-devel] [PATCH 2/3] qemu-ga: Add interface to traverse the qmp command list by QmpCommand Michael Roth
2013-10-10 20:09 ` [Qemu-devel] [PATCH 3/3] qemu-ga: Extend 'guest-info' command to expose flag 'success-response' Michael Roth
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=1381435782-25524-2-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=aliguori@amazon.com \
--cc=qemu-devel@nongnu.org \
--cc=tomoki.sekiyama@hds.com \
--cc=wudxw@linux.vnet.ibm.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).