mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0018-RHEL-7-daemon-umount-all-Hack-to-avoid-umount-sysroo.patch

a30de4
From 5cd87d524afba59a3916f4c953a4e4b6bccf8c04 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Thu, 23 Jul 2015 18:15:36 -0400
ffd6ed
Subject: [PATCH] RHEL 7: daemon: umount-all: Hack to avoid umount: /sysroot:
ffd6ed
 target is busy (RHBZ#1246032).
ffd6ed
ffd6ed
This bug is not properly understood (although readily reproducible).
ffd6ed
However this hack makes it go away for now.
ffd6ed
ffd6ed
https://bugzilla.redhat.com/show_bug.cgi?id=1246032
ffd6ed
---
ffd6ed
 daemon/mount.c | 5 +++++
ffd6ed
 1 file changed, 5 insertions(+)
ffd6ed
ffd6ed
diff --git a/daemon/mount.c b/daemon/mount.c
a30de4
index 0ad9626a7..b44753441 100644
ffd6ed
--- a/daemon/mount.c
ffd6ed
+++ b/daemon/mount.c
90a56e
@@ -28,6 +28,8 @@
ffd6ed
 #include <sys/types.h>
ffd6ed
 #include <mntent.h>
ffd6ed
 
ffd6ed
+#include "ignore-value.h"
ffd6ed
+
ffd6ed
 #include "daemon.h"
ffd6ed
 #include "actions.h"
ffd6ed
 
90a56e
@@ -408,6 +410,9 @@ do_umount_all (void)
ffd6ed
   if (mounts.size > 0)
ffd6ed
     qsort (mounts.argv, mounts.size, sizeof (char *), compare_longest_first);
ffd6ed
 
ffd6ed
+  /* Hack to work around RHBZ#1246032. */
ffd6ed
+  ignore_value (system ("lsof /sysroot"));
ffd6ed
+
ffd6ed
   /* Unmount them. */
ffd6ed
   for (i = 0; i < mounts.size; ++i) {
ffd6ed
     CLEANUP_FREE char *err = NULL;
ffd6ed
-- 
a30de4
2.14.3
ffd6ed