From 5e6c8fa8669aea288fa3e62443705b07178c6507 Mon Sep 17 00:00:00 2001 From: yanan-rock Date: Sun, 18 Apr 2021 03:08:03 -0400 Subject: [PATCH] python-blivet:Account for pmspare grow when adjusting thinpool metadata Signed-off-by: yanan-rock (cherry picked from commit 5242e76acf316a70f23596e15774a73b8f742428) --- ...row-when-adjusting-thinpool-metadata.patch | 36 +++++++++++++++++++ python-blivet.spec | 10 ++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch diff --git a/backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch b/backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch new file mode 100644 index 0000000..8f2c415 --- /dev/null +++ b/backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch @@ -0,0 +1,36 @@ +From 0004c2b86f5587aa4d159b2f99c66d0eba141b4f Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 19 Aug 2020 13:08:00 +0200 +Subject: [PATCH] Account for pmspare grow when adjusting thinpool metadata + size + +When making space for the bigger metadata we also need to make +extra space for pmspare because its size depends on the metadata +size. + +Resolves: rhbz#1868623 +--- + blivet/devices/lvm.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py +index 38d050321..b003b7b46 100644 +--- a/blivet/devices/lvm.py ++++ b/blivet/devices/lvm.py +@@ -1631,6 +1631,7 @@ def autoset_md_size(self, enforced=False): + log.debug("Using default chunk size: %s", self._chunk_size) + + old_md_size = self._metadata_size ++ old_pmspare_size = self.vg.pmspare_size + self._metadata_size = Size(blockdev.lvm.get_thpool_meta_size(self._size, + self._chunk_size, + 100)) # snapshots +@@ -1642,7 +1643,7 @@ def autoset_md_size(self, enforced=False): + if self._metadata_size == old_md_size: + log.debug("Rounded metadata size unchanged") + else: +- new_size = self.size - (self._metadata_size - old_md_size) ++ new_size = self.size - (self._metadata_size - old_md_size) - (self.vg.pmspare_size - old_pmspare_size) + log.debug("Adjusting size from %s MiB to %s MiB", + self.size.convert_to("MiB"), new_size.convert_to("MiB")) + self.size = new_size diff --git a/python-blivet.spec b/python-blivet.spec index 158f554..c376422 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.2.2 -Release: 3 +Release: 4 Epoch: 1 Summary: A python module for system storage configuration License: LGPLv2+ @@ -20,7 +20,7 @@ BuildRequires: python2-devel python2-setuptools Patch0: 0001-force-lvm-plugin.patch Patch1: Fix-name-resolution-for-MD-devices-and-partitions-on.patch Patch9000: fix-the-long-hostname.patch - +Patch6000: backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch %description The python-blivet package is a python module for examining and modifying @@ -121,6 +121,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README %changelog +* Tue May 25 2021 yanan - 3.2.2-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Account for pmspare grow when adjusting thinpool metadata + * Wed Nov 18 2020 gaihuiying - 3.2.2-3 - Type:bugfix - ID:NA -- Gitee