import libblockdev-2.24-8.el8
This commit is contained in:
parent
2850fa7006
commit
1018f5c7f7
27
SOURCES/0006-Fix-vdo-stats-calculation.patch
Normal file
27
SOURCES/0006-Fix-vdo-stats-calculation.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 2f2dd62b6f6aa61f14f108b95cee7e82f4114614 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||||
|
Date: Mon, 22 Nov 2021 14:16:02 +0100
|
||||||
|
Subject: [PATCH] vdo_stats: Default to 100 % savings for invalid savings
|
||||||
|
values
|
||||||
|
|
||||||
|
We are currently using "-1" when VDO logical_blocks_used is 0
|
||||||
|
which doesn't match the LVM logic which returns 100 so to make
|
||||||
|
both values in vdo_info and vdo_stats equal we should return 100
|
||||||
|
in this case too.
|
||||||
|
---
|
||||||
|
src/plugins/vdo_stats.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/plugins/vdo_stats.c b/src/plugins/vdo_stats.c
|
||||||
|
index ed04b5101..9f2a24c89 100644
|
||||||
|
--- a/src/plugins/vdo_stats.c
|
||||||
|
+++ b/src/plugins/vdo_stats.c
|
||||||
|
@@ -96,7 +96,7 @@ static void add_block_stats (GHashTable *stats) {
|
||||||
|
g_hash_table_replace (stats, g_strdup ("oneKBlocksUsed"), g_strdup_printf ("%"G_GINT64_FORMAT, (data_blocks_used + overhead_blocks_used) * block_size / 1024));
|
||||||
|
g_hash_table_replace (stats, g_strdup ("oneKBlocksAvailable"), g_strdup_printf ("%"G_GINT64_FORMAT, (physical_blocks - data_blocks_used - overhead_blocks_used) * block_size / 1024));
|
||||||
|
g_hash_table_replace (stats, g_strdup ("usedPercent"), g_strdup_printf ("%.0f", 100.0 * (gfloat) (data_blocks_used + overhead_blocks_used) / (gfloat) physical_blocks + 0.5));
|
||||||
|
- savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : -1;
|
||||||
|
+ savings = (logical_blocks_used > 0) ? (gint64) (100.0 * (gfloat) (logical_blocks_used - data_blocks_used) / (gfloat) logical_blocks_used) : 100;
|
||||||
|
g_hash_table_replace (stats, g_strdup ("savings"), g_strdup_printf ("%"G_GINT64_FORMAT, savings));
|
||||||
|
if (savings >= 0)
|
||||||
|
g_hash_table_replace (stats, g_strdup ("savingPercent"), g_strdup_printf ("%"G_GINT64_FORMAT, savings));
|
@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
Name: libblockdev
|
Name: libblockdev
|
||||||
Version: 2.24
|
Version: 2.24
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
Summary: A library for low-level manipulation with block devices
|
Summary: A library for low-level manipulation with block devices
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://github.com/storaged-project/libblockdev
|
URL: https://github.com/storaged-project/libblockdev
|
||||||
@ -135,6 +135,7 @@ Patch1: 0002-exec-polling-fixes.patch
|
|||||||
Patch2: 0003-LVM-thin-metadata-calculation-fix.patch
|
Patch2: 0003-LVM-thin-metadata-calculation-fix.patch
|
||||||
Patch3: 0004-Fix-default-key-size-for-non-XTS-ciphers.patch
|
Patch3: 0004-Fix-default-key-size-for-non-XTS-ciphers.patch
|
||||||
Patch4: 0005-Add-workarounds-for-some-LVM-test-issues.patch
|
Patch4: 0005-Add-workarounds-for-some-LVM-test-issues.patch
|
||||||
|
Patch5: 0006-Fix-vdo-stats-calculation.patch
|
||||||
|
|
||||||
BuildRequires: glib2-devel
|
BuildRequires: glib2-devel
|
||||||
%if %{with_gi}
|
%if %{with_gi}
|
||||||
@ -695,6 +696,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
|
|||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
|
%patch5 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -ivf
|
autoreconf -ivf
|
||||||
@ -998,6 +1000,10 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
|||||||
%files plugins-all
|
%files plugins-all
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 07 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-8
|
||||||
|
- Fix vdo stats calculation
|
||||||
|
Resolves: rhbz#2023883
|
||||||
|
|
||||||
* Wed Jun 30 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-7
|
* Wed Jun 30 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-7
|
||||||
- Add workarounds for some LVM test issues
|
- Add workarounds for some LVM test issues
|
||||||
Resolves: rhbz#1974352
|
Resolves: rhbz#1974352
|
||||||
|
Loading…
Reference in New Issue
Block a user