Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:27 +0200
commitcda0663b5f6a424273367504e74966f088a41948 (patch)
treed13f81bb86c5f32cbf0ed1ad0ced7456a448dcb8
parentd1f8c37317e60091468a74141bd69ab97d2b9850 (diff)
Tools: hv: vss: Skip freezing filesystems backed by loop
-rw-r--r--patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch63
-rw-r--r--series.conf1
2 files changed, 64 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch b/patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch
new file mode 100644
index 0000000000..84c749bc7c
--- /dev/null
+++ b/patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch
@@ -0,0 +1,63 @@
+From: Alex Ng <alexng@messages.microsoft.com>
+Date: Sun, 6 Aug 2017 13:12:52 -0700
+Patch-mainline: v4.14-rc1
+Subject: Tools: hv: vss: Skip freezing filesystems backed by loop
+Git-commit: ea81fdf0981d9a4a998a015d325bed67624811f7
+References: fate#323887
+
+Since a loop device is backed by a file, a backup will already result in
+its parent filesystem being frozen. It's sufficient to just freeze the
+parent filesystem, so we can skip the loop device.
+
+This avoids a situation where a loop device and its parent filesystem are
+both frozen and then thawed out of order. For example, if the loop device
+is enumerated first, we would thaw it while its parent filesystem is still
+frozen. The thaw operation fails and the loop device remains frozen.
+
+Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
+Signed-off-by: Vyronas Tsingaras <vyronas@vtsingaras.me>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ tools/hv/hv_vss_daemon.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
+--- a/tools/hv/hv_vss_daemon.c
++++ b/tools/hv/hv_vss_daemon.c
+@@ -21,6 +21,7 @@
+ #include <sys/types.h>
+ #include <sys/poll.h>
+ #include <sys/ioctl.h>
++#include <sys/stat.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <mntent.h>
+@@ -30,6 +31,7 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <linux/fs.h>
++#include <linux/major.h>
+ #include <linux/hyperv.h>
+ #include <syslog.h>
+ #include <getopt.h>
+@@ -70,6 +72,7 @@ static int vss_operate(int operation)
+ char match[] = "/dev/";
+ FILE *mounts;
+ struct mntent *ent;
++ struct stat sb;
+ char errdir[1024] = {0};
+ unsigned int cmd;
+ int error = 0, root_seen = 0, save_errno = 0;
+@@ -92,6 +95,10 @@ static int vss_operate(int operation)
+ while ((ent = getmntent(mounts))) {
+ if (strncmp(ent->mnt_fsname, match, strlen(match)))
+ continue;
++ if (stat(ent->mnt_fsname, &sb) == -1)
++ continue;
++ if (S_ISBLK(sb.st_mode) && major(sb.st_rdev) == LOOP_MAJOR)
++ continue;
+ if (hasmntopt(ent, MNTOPT_RO) != NULL)
+ continue;
+ if (strcmp(ent->mnt_type, "vfat") == 0)
diff --git a/series.conf b/series.conf
index 7ce60fa78e..be99054ffa 100644
--- a/series.conf
+++ b/series.conf
@@ -1685,6 +1685,7 @@
patches.suse/msft-hv-1432-netvsc-remove-unnecessary-check-for-NULL-hdr.patch
patches.suse/msft-hv-1433-netvsc-allow-controlling-send-recv-buffer-size.patch
patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch
+ patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch