Do not try to normalize size for zero size device factories

Resolves: rhbz#1743753
This commit is contained in:
Vojtech Trefny 2019-08-27 12:26:55 +02:00
parent 27e981cd2a
commit 702613215f
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 8b76e2d72cca787747a2c639edbdfa0af28f9878 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Fri, 23 Aug 2019 09:47:32 +0200
Subject: [PATCH] Do not try to normalize size for zero size device factories
Factories with zero size are special cases for adjusting container
size after removing a device for it. We don't want to change size
of the factory in this case.
The recent change of filesystem minimal size to 2 MiB resulted
in changing of size of these factories from 0 to 2 MiB which
caused the "adjusting factory" to create a new LV after removing
one from the container.
Resolves: rhbz#1743753
---
blivet/devicefactory.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index e910c5bd..0eb548c7 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -462,6 +462,10 @@ def _get_free_disk_space(self):
def _normalize_size(self):
if self.size is None:
self._handle_no_size()
+ elif self.size == Size(0):
+ # zero size means we're adjusting the container after removing
+ # a device from it so we don't want to change the size here
+ return
size = self.size
fmt = get_format(self.fstype)

View File

@ -23,7 +23,7 @@ Version: 3.1.5
#%%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
@ -31,6 +31,7 @@ License: LGPLv2+
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-initial-PowerNV-class-support.patch
Patch1: 0002-Do-not-try-to-normalize-size-for-zero-size-device-factories.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -192,6 +193,9 @@ configuration.
%endif
%changelog
* Tue Aug 27 2019 Vojtech Trefny <vtrefny@redhat.com> - 3.1.5-2
- Do not try to normalize size for zero size device factories (#1743753)
* Thu Aug 15 2019 Vojtech Trefny <vtrefny@redhat.com> - 3.1.5-1
- Move dependencies code from StorageDevice to Device (vtrefny)
- Always use luks_data.min_entropy as a default minimum entropy (vponcova)