mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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