Special bind-mounts can be lazy unmounted
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
parent
e76504900b
commit
3a6eb5e914
@ -17,7 +17,7 @@
|
|||||||
Summary: Tools for building live CDs
|
Summary: Tools for building live CDs
|
||||||
Name: livecd-tools
|
Name: livecd-tools
|
||||||
Version: 31.0
|
Version: 31.0
|
||||||
Release: 2.1.riscv64%{?dist}
|
Release: 2.2.riscv64%{?dist}
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
%endif
|
%endif
|
||||||
@ -229,6 +229,10 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.2.riscv64
|
||||||
|
- Lower wait to 10.
|
||||||
|
- Specia bind-mounts can be lazy unmounted.
|
||||||
|
|
||||||
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.1.riscv64
|
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.1.riscv64
|
||||||
- Wait 600 seconds before calling umount
|
- Wait 600 seconds before calling umount
|
||||||
- Dump pstree output with pids
|
- Dump pstree output with pids
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
|
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
|
||||||
index f999d05..83a8928 100644
|
index f999d05..5c5a003 100644
|
||||||
--- a/imgcreate/fs.py
|
--- a/imgcreate/fs.py
|
||||||
+++ b/imgcreate/fs.py
|
+++ b/imgcreate/fs.py
|
||||||
@@ -820,8 +820,18 @@ class DiskMount(Mount):
|
@@ -820,8 +820,18 @@ class DiskMount(Mount):
|
||||||
def unmount(self):
|
def unmount(self):
|
||||||
if self.mounted:
|
if self.mounted:
|
||||||
logging.info("Unmounting directory %s" % self.mountdir)
|
logging.info("Unmounting directory %s" % self.mountdir)
|
||||||
+ time.sleep(600)
|
+ time.sleep(10)
|
||||||
rc = call(['umount', self.mountdir])
|
rc = call(['umount', self.mountdir])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
+ logging.info("- - - lsof %s - - -" % self.mountdir)
|
+ logging.info("- - - lsof %s - - -" % self.mountdir)
|
||||||
@ -25,7 +25,7 @@ index f999d05..83a8928 100644
|
|||||||
if not self.mounted:
|
if not self.mounted:
|
||||||
return
|
return
|
||||||
|
|
||||||
+ time.sleep(600)
|
+ time.sleep(10)
|
||||||
rc = call(['umount', self.mountdir])
|
rc = call(['umount', self.mountdir])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
+ logging.info("- - - lsof %s - - -" % self.mountdir)
|
+ logging.info("- - - lsof %s - - -" % self.mountdir)
|
||||||
@ -40,11 +40,11 @@ index f999d05..83a8928 100644
|
|||||||
call(['umount', '-l', self.mountdir])
|
call(['umount', '-l', self.mountdir])
|
||||||
raise MountError(umount_fail_fmt % self.mountdir)
|
raise MountError(umount_fail_fmt % self.mountdir)
|
||||||
if self.cowmnt:
|
if self.cowmnt:
|
||||||
@@ -1059,8 +1079,18 @@ class BindChrootMount():
|
@@ -1059,10 +1079,21 @@ class BindChrootMount():
|
||||||
self.mounted = False
|
self.mounted = False
|
||||||
return
|
return
|
||||||
|
|
||||||
+ time.sleep(600)
|
+ time.sleep(10)
|
||||||
rc = call(['umount', self.dest])
|
rc = call(['umount', self.dest])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
+ logging.info("- - - lsof %s - - -" % self.dest)
|
+ logging.info("- - - lsof %s - - -" % self.dest)
|
||||||
@ -57,8 +57,12 @@ index f999d05..83a8928 100644
|
|||||||
+ call(['pstree', '-Talp'])
|
+ call(['pstree', '-Talp'])
|
||||||
+ logging.info("- - - pstree - - -")
|
+ logging.info("- - - pstree - - -")
|
||||||
call(['umount', '-l', self.dest])
|
call(['umount', '-l', self.dest])
|
||||||
raise MountError(umount_fail_fmt % self.dest)
|
- raise MountError(umount_fail_fmt % self.dest)
|
||||||
|
+ if self.src.strip() not in ('/sys', '/proc', '/dev/pts'):
|
||||||
|
+ raise MountError(umount_fail_fmt % self.dest)
|
||||||
self.mounted = False
|
self.mounted = False
|
||||||
|
|
||||||
|
def cleanup(self):
|
||||||
diff --git a/imgcreate/util.py b/imgcreate/util.py
|
diff --git a/imgcreate/util.py b/imgcreate/util.py
|
||||||
index fad6772..04380c9 100644
|
index fad6772..04380c9 100644
|
||||||
--- a/imgcreate/util.py
|
--- a/imgcreate/util.py
|
||||||
|
Loading…
Reference in New Issue
Block a user