[meta-anaconda,1/1] initramfs-module-setup-live: call udev settle before umounting /run/media/*

Submitted by Ovidiu Panait on Sept. 23, 2019, 6:41 a.m. | Patch ID: 165230

Details

Message ID 20190923064135.18204-1-ovidiu.panait@windriver.com
State New
Headers show

Commit Message

Ovidiu Panait Sept. 23, 2019, 6:41 a.m.
This fixes a race conditition which leaves devices mounted, causing the
following anaconda installation failure:
File "/usr/lib64/python3.5/site-packages/gi/overrides/BlockDev.py", line 963, in wrapped
  raise transform[1](msg)
File "/usr/lib64/python3.5/site-packages/blivet/devices/lvm.py", line 913, in _teardown
  blockdev.lvm.lvdeactivate(self.vg.name, self._name)
File "/usr/lib64/python3.5/site-packages/blivet/threads.py", line 53, in run_with_lock
  return m(*args, **kwargs)
File "/usr/lib64/python3.5/site-packages/blivet/devices/storage.py", line 431, in teardown
  self._teardown(recursive=recursive)
File "/usr/lib64/python3.5/site-packages/blivet/threads.py", line 53, in run_with_lock
  return m(*args, **kwargs)
File "/usr/lib64/python3.5/site-packages/blivet/devices/lvm.py", line 1933, in teardown
  return DMDevice.teardown(self, recursive)
gi.overrides.BlockDev.LVMError: Process reported exit code 5:   Logical volume wrll_intel-x86-64/root contains a filesystem in use.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---
 recipes-installer/initrdscripts/files/umountfs | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/recipes-installer/initrdscripts/files/umountfs b/recipes-installer/initrdscripts/files/umountfs
index f01adea..4792110 100644
--- a/recipes-installer/initrdscripts/files/umountfs
+++ b/recipes-installer/initrdscripts/files/umountfs
@@ -3,6 +3,9 @@  umountfs_enabled() {
 }
 
 umountfs_run() {
+    # Make sure /run/media is fully populated
+    udevadm settle
+
     # Umount other media for anaconda
     for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
         umount $dir

Comments

Hongxu Jia Sept. 23, 2019, 1:59 p.m.
Merged

//Hongxu
On 9/23/19 2:41 PM, Ovidiu Panait wrote:
> This fixes a race conditition which leaves devices mounted, causing the
> following anaconda installation failure:
> File "/usr/lib64/python3.5/site-packages/gi/overrides/BlockDev.py", line 963, in wrapped
>    raise transform[1](msg)
> File "/usr/lib64/python3.5/site-packages/blivet/devices/lvm.py", line 913, in _teardown
>    blockdev.lvm.lvdeactivate(self.vg.name, self._name)
> File "/usr/lib64/python3.5/site-packages/blivet/threads.py", line 53, in run_with_lock
>    return m(*args, **kwargs)
> File "/usr/lib64/python3.5/site-packages/blivet/devices/storage.py", line 431, in teardown
>    self._teardown(recursive=recursive)
> File "/usr/lib64/python3.5/site-packages/blivet/threads.py", line 53, in run_with_lock
>    return m(*args, **kwargs)
> File "/usr/lib64/python3.5/site-packages/blivet/devices/lvm.py", line 1933, in teardown
>    return DMDevice.teardown(self, recursive)
> gi.overrides.BlockDev.LVMError: Process reported exit code 5:   Logical volume wrll_intel-x86-64/root contains a filesystem in use.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> ---
>   recipes-installer/initrdscripts/files/umountfs | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/recipes-installer/initrdscripts/files/umountfs b/recipes-installer/initrdscripts/files/umountfs
> index f01adea..4792110 100644
> --- a/recipes-installer/initrdscripts/files/umountfs
> +++ b/recipes-installer/initrdscripts/files/umountfs
> @@ -3,6 +3,9 @@ umountfs_enabled() {
>   }
>   
>   umountfs_run() {
> +    # Make sure /run/media is fully populated
> +    udevadm settle
> +
>       # Umount other media for anaconda
>       for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
>           umount $dir