mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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