Invalidate LVM caches in blivet device discovery loop (#1824418)

This commit is contained in:
Vojtech Trefny 2020-04-21 00:02:25 +02:00
parent 691753c794
commit afb92590cb
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 394ff40554ab8b3ce9ff0aa5af0c8c2ead6522a3 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Mon, 20 Apr 2020 11:01:10 -0700
Subject: [PATCH] Invalidate LVM caches in blivet device discovery loop
(#1824418)
This should work around a problem where we sometimes fail to
correctly evaluate existing logical volumes, though it is not a
correct fix for the underlying problem (which we haven't exactly
identified yet) but a workaround for Fedora 32 release.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
blivet/populator/populator.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py
index 465c272d..3e1d16f3 100644
--- a/blivet/populator/populator.py
+++ b/blivet/populator/populator.py
@@ -24,6 +24,7 @@ import os
import pprint
import copy
import parted
+import time
from six import add_metaclass
import gi
@@ -454,6 +455,9 @@ class PopulatorMixin(object):
callbacks.populate_started(n_devices=n_devices)
report = False
+ time.sleep(2)
+ self.drop_lvm_cache()
+ mpath_members.drop_cache()
log.info("devices to scan: %s", [udev.device_get_name(d) for d in devices])
for dev in devices:
self.handle_device(dev)
--
2.26.1

View File

@ -23,13 +23,14 @@ Version: 3.2.1
#%%global prerelease .b2
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 1%{?prerelease}%{?dist}
Release: 2%{?prerelease}%{?dist}
Epoch: 1
License: LGPLv2+
%global realname blivet
%global realversion %{version}%{?prerelease}
Source0: http://github.com/storaged-project/blivet/archive/%{realname}-%{realversion}.tar.gz
Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realversion}-tests.tar.gz
Patch0: 0001-Invalidate-LVM-caches-in-blivet-device-discovery-loop.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -191,6 +192,9 @@ configuration.
%endif
%changelog
* Tue Apr 21 2020 Vojtech Trefny <vtrefny@redhat.com> - 3.2.1-2
- Invalidate LVM caches in blivet device discovery loop (#1824418)
* Mon Apr 06 2020 Vojtech Trefny <vtrefny@redhat.com> - 3.2.1-1
- Correctly recognize EFI format on an MD RAID device (#1695913) (vtrefny)
- Do not set empty name instead of invalid one in devicefactory (#1813710) (vtrefny)