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

151578
From 5cd87d524afba59a3916f4c953a4e4b6bccf8c04 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
151578
index 0ad9626a7..b44753441 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
 
151578
@@ -408,6 +410,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
-- 
151578
2.14.3
151578