summary refs log tree commit diff stats
path: root/qga/commands-posix.c
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2017-01-31 16:36:34 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-03-06 00:54:18 -0600
commitce2eb6c4a044d809caf4dc4e08aed77678f9760e (patch)
tree725230b76657f78c5fdcfb8b922c64c0ee12767b /qga/commands-posix.c
parent26de229657b943b7a59ad79c387506f6f33ff963 (diff)
downloadfocaccia-qemu-ce2eb6c4a044d809caf4dc4e08aed77678f9760e.tar.gz
focaccia-qemu-ce2eb6c4a044d809caf4dc4e08aed77678f9760e.zip
qga: ignore EBUSY when freezing a filesystem
the current implementation fails if we try to freeze an
already frozen filesystem. This can happen if a filesystem
is mounted more than once (e.g. with a bind mount).

Suggested-by: Christian Theune <ct@flyingcircus.io>
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r--qga/commands-posix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index ea37c097cf..73d93eb5ce 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1243,6 +1243,9 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
          * filesystems may not implement fsfreeze for less obvious reasons.
          * these will report EOPNOTSUPP. we simply ignore these when tallying
          * the number of frozen filesystems.
+         * if a filesystem is mounted more than once (aka bind mount) a
+         * consecutive attempt to freeze an already frozen filesystem will
+         * return EBUSY.
          *
          * any other error means a failure to freeze a filesystem we
          * expect to be freezable, so return an error in those cases
@@ -1250,7 +1253,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
          */
         ret = ioctl(fd, FIFREEZE);
         if (ret == -1) {
-            if (errno != EOPNOTSUPP) {
+            if (errno != EOPNOTSUPP && errno != EBUSY) {
                 error_setg_errno(errp, errno, "failed to freeze %s",
                                  mount->dirname);
                 close(fd);