imgcreate/fs.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 73bd6807678ff80b46196b7113f0582f03e84637
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Jul 24 08:26:56 2010 -0500
Do lazy umounts to reduce the impact of umount issues.
By doing lazy umounts, if a umount can't be done (such as in the case of
the problem triggered by bug 617844), livecd-creator doesn't clean up after
itself. This ties up storage and loop devices.
This will mitigate problems where mounts are pinned by livecd-creator,
umounts are incorrectly done in the wrong order, or if the user is poking
around in the mount points while livecd-creator is running. It will not
fix a case where a umount is missed.
This should mitigate the symptoms of bug 509427, but not the root cause
(which is likely the problem reported in bug 617844.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 142ecd2..16445a5 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -112,7 +112,7 @@ class BindChrootMount:
if not self.mounted:
return
- rc = subprocess.call(["/bin/umount", self.dest])
+ rc = subprocess.call(["/bin/umount", "-l", self.dest])
if rc != 0:
raise MountError("Unable to unmount filesystem at %s" % self.dest)
self.mounted = False
@@ -353,7 +353,7 @@ class DiskMount(Mount):
def unmount(self):
if self.mounted:
logging.debug("Unmounting directory %s" % self.mountdir)
- rc = subprocess.call(["/bin/umount", self.mountdir])
+ rc = subprocess.call(["/bin/umount", "-l",
self.mountdir])
if rc == 0:
self.mounted = False
else: