New version

- Skip btrfs min size tests on Fedora 25 (vtrefny)
- Make sure the loop device doesn't disappear during tests (vpodzime)
- Close the loop device when autoclear is (un)set (vpodzime)
- Do not enforce Python 3 for running tests in CI (vpodzime)
- Revert "Use different BTRFS_MIN_MEMBER_SIZE on aarch64" (vtrefny)
- Use both 'old' and 'new' sysfs files to read zRAM stats (vtrefny)
- Check if libparted-fs-resize pkgconfig is available (vpodzime)
- Do not try to get name for inactive partitions (vtrefny)
- Skip tests for getting free regions on CentOS/RHEL (vpodzime)
- Free the container holding the specs of free regions (vpodzime)
- Open loop devices as O_RDONLY when getting flags (vpodzime)
- Resolve maximum partition size when we know its start (vpodzime)
- Use --id instead of --part-type when setting partition id (vpodzime)
- Fix mdadm command for removing failed device from an array (vtrefny)
- Skip bcache tests on CentOS/RHEL 7 (vpodzime)
- Use six.assertRaisesRegex in the FS tests (vpodzime)
- Use mkdtemp() instead of TemporaryDirectory() (vpodzime)
- Fix installation without specifying --exec-prefix (vpodzime)
- Add options to force mkfs.ext4/vfat to create a FS on the whole device (vpodzime)
- Skip the test for device escrow on CentOS/RHEL (vpodzime)
- Define DEVNULL on our own if not in subprocess (vpodzime)
- Remove the patches from the spec file (vpodzime)
- Sync the spec file with downstream (vpodzime)
- Stop skipping zRAM stats tests (vtrefny)
- Add more tests for zRAM stats (vtrefny)
- Fix reading zRAM properties from sysfs (vtrefny)
This commit is contained in:
Vratislav Podzimek 2017-04-26 12:57:28 +02:00
parent a41ab57be1
commit 7b8a07d71b
5 changed files with 32 additions and 148 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@
/libblockdev-2.4.tar.gz
/libblockdev-2.5.tar.gz
/libblockdev-2.6.tar.gz
/libblockdev-2.7.tar.gz

View File

@ -63,16 +63,13 @@
%define configure_opts %{?distro_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} %{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} %{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts}
Name: libblockdev
Version: 2.6
Release: 3%{?dist}
Version: 2.7
Release: 1%{?dist}
Summary: A library for low-level manipulation with block devices
License: LGPLv2+
URL: https://github.com/rhinstaller/libblockdev
Source0: https://github.com/rhinstaller/libblockdev/archive/%{name}-%{version}.tar.gz
Patch0: valid_thpool_md_size.patch
Patch1: md_activate_fix.patch
BuildRequires: glib2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: python-devel
@ -520,8 +517,6 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%build
%configure %{?configure_opts}
@ -791,6 +786,34 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%files plugins-all
%changelog
* Wed Apr 26 2017 Vratislav Podzimek <vpodzime@redhat.com> - 2.7-1
- Skip btrfs min size tests on Fedora 25 (vtrefny)
- Make sure the loop device doesn't disappear during tests (vpodzime)
- Close the loop device when autoclear is (un)set (vpodzime)
- Do not enforce Python 3 for running tests in CI (vpodzime)
- Revert "Use different BTRFS_MIN_MEMBER_SIZE on aarch64" (vtrefny)
- Use both 'old' and 'new' sysfs files to read zRAM stats (vtrefny)
- Check if libparted-fs-resize pkgconfig is available (vpodzime)
- Do not try to get name for inactive partitions (vtrefny)
- Skip tests for getting free regions on CentOS/RHEL (vpodzime)
- Free the container holding the specs of free regions (vpodzime)
- Open loop devices as O_RDONLY when getting flags (vpodzime)
- Resolve maximum partition size when we know its start (vpodzime)
- Use --id instead of --part-type when setting partition id (vpodzime)
- Fix mdadm command for removing failed device from an array (vtrefny)
- Skip bcache tests on CentOS/RHEL 7 (vpodzime)
- Use six.assertRaisesRegex in the FS tests (vpodzime)
- Use mkdtemp() instead of TemporaryDirectory() (vpodzime)
- Fix installation without specifying --exec-prefix (vpodzime)
- Add options to force mkfs.ext4/vfat to create a FS on the whole device (vpodzime)
- Skip the test for device escrow on CentOS/RHEL (vpodzime)
- Define DEVNULL on our own if not in subprocess (vpodzime)
- Remove the patches from the spec file (vpodzime)
- Sync the spec file with downstream (vpodzime)
- Stop skipping zRAM stats tests (vtrefny)
- Add more tests for zRAM stats (vtrefny)
- Fix reading zRAM properties from sysfs (vtrefny)
* Wed Apr 12 2017 Vratislav Podzimek <vpodzime@redhat.com> - 2.6-3
- Do not try to parse 'raid_spec' for 'bd_md_activate' (vtrefny)
Resolves: rhbz#1439111

View File

@ -1,65 +0,0 @@
From 44bb54dc76c1adb2d0263343a00016537a334d5f Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Wed, 12 Apr 2017 08:37:39 +0200
Subject: [PATCH] Do not try to parse 'raid_spec' for 'bd_md_activate'
(#1439111)
It is possible to call 'mdadm --assemble' using the '/dev/md...'
path so do not try to parse/check given raid specification --
even non-existing path is a valid input for this function.
---
src/plugins/mdraid.c | 12 ++----------
tests/mdraid_test.py | 4 +++-
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
index c7cfe2a..e5e5f8b 100644
--- a/src/plugins/mdraid.c
+++ b/src/plugins/mdraid.c
@@ -635,7 +635,6 @@ gboolean bd_md_activate (const gchar *raid_spec, const gchar **members, const gc
guint64 num_members = (raid_spec && members) ? g_strv_length ((gchar **) members) : 0;
const gchar **argv = NULL;
gchar *uuid_str = NULL;
- gchar *mdadm_spec = NULL;
guint argv_top = 0;
guint i = 0;
gboolean ret = FALSE;
@@ -643,17 +642,10 @@ gboolean bd_md_activate (const gchar *raid_spec, const gchar **members, const gc
/* mdadm, --assemble, raid_spec/--scan, --run, --uuid=uuid, member1, member2,..., NULL*/
argv = g_new0 (const gchar*, num_members + 6);
- if (raid_spec) {
- mdadm_spec = get_mdadm_spec_from_input (raid_spec, error);
- if (!mdadm_spec)
- /* error is already populated */
- return FALSE;
- }
-
argv[argv_top++] = "mdadm";
argv[argv_top++] = "--assemble";
- if (mdadm_spec)
- argv[argv_top++] = mdadm_spec;
+ if (raid_spec)
+ argv[argv_top++] = raid_spec;
else
argv[argv_top++] = "--scan";
if (start_degraded)
diff --git a/tests/mdraid_test.py b/tests/mdraid_test.py
index 09c8542..0a526d1 100644
--- a/tests/mdraid_test.py
+++ b/tests/mdraid_test.py
@@ -227,8 +227,10 @@ class MDTestActivateDeactivate(MDTestCase):
succ = BlockDev.md_deactivate(BlockDev.md_node_from_name("bd_test_md"))
self.assertTrue(succ)
+ # try to activate using full path, not just the name
+ # (it should work too and blivet does this)
with wait_for_action("resync"):
- succ = BlockDev.md_activate("bd_test_md",
+ succ = BlockDev.md_activate("/dev/md/bd_test_md",
[self.loop_dev, self.loop_dev2, self.loop_dev3], None)
self.assertTrue(succ)
--
2.9.3

View File

@ -1 +1 @@
SHA512 (libblockdev-2.6.tar.gz) = a9c42a3ac6ef703d1c8cbdb6f0c67ee1e4245ecb3876bce16b97fbdb5249b668c5935577410eb85253bb558d0726b2183163332234b508e88400ad2cb20438a0
SHA512 (libblockdev-2.7.tar.gz) = ca9ec182c03fc3853b37883c9f4a278fa89cd1cc3cbf3c41456c407107da4b9e7e226684edb479275407eae7f3d03bbc261bf384fa08c4aa8997fd6e245ee8ce

View File

@ -1,75 +0,0 @@
From 2b510a862dfc120e9e5592ba15112385b6c8c371 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Mon, 3 Apr 2017 13:54:52 +0200
Subject: [PATCH] Make sure the returned thpool MD size is valid
It may be too small as given by the thin_metadata_size tool which
obviously doesn't guard for too small values.
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
---
src/plugins/lvm-dbus.c | 2 +-
src/plugins/lvm.c | 2 +-
tests/lvm_dbus_tests.py | 4 ++++
tests/lvm_test.py | 4 ++++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
index 25cb82a..86a5383 100644
--- a/src/plugins/lvm-dbus.c
+++ b/src/plugins/lvm-dbus.c
@@ -1097,7 +1097,7 @@ guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n
return 0;
}
- return ret;
+ return MAX (ret, BD_LVM_MIN_THPOOL_MD_SIZE);
}
/**
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
index a8acc69..21a20ba 100644
--- a/src/plugins/lvm.c
+++ b/src/plugins/lvm.c
@@ -615,7 +615,7 @@ guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n
return 0;
}
- return ret;
+ return MAX (ret, BD_LVM_MIN_THPOOL_MD_SIZE);
}
/**
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
index 4ba93e9..998f97c 100644
--- a/tests/lvm_dbus_tests.py
+++ b/tests/lvm_dbus_tests.py
@@ -130,6 +130,10 @@ class LvmNoDevTestCase(unittest.TestCase):
# twice the chunk_size -> roughly half the metadata needed
self.assertAlmostEqual(float(out1) / float(out2), 2, places=2)
+ # unless thin_metadata_size gives a value that is not valid (too small)
+ self.assertEqual(BlockDev.lvm_get_thpool_meta_size (100 * 1024**2, 128 * 1024, 100),
+ BlockDev.LVM_MIN_THPOOL_MD_SIZE)
+
def test_is_valid_thpool_md_size(self):
"""Verify that is_valid_thpool_md_size works as expected"""
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
index 4879808..c7fedbd 100644
--- a/tests/lvm_test.py
+++ b/tests/lvm_test.py
@@ -114,6 +114,10 @@ class LvmNoDevTestCase(unittest.TestCase):
# twice the chunk_size -> roughly half the metadata needed
self.assertAlmostEqual(float(out1) / float(out2), 2, places=2)
+ # unless thin_metadata_size gives a value that is not valid (too small)
+ self.assertEqual(BlockDev.lvm_get_thpool_meta_size (100 * 1024**2, 128 * 1024, 100),
+ BlockDev.LVM_MIN_THPOOL_MD_SIZE)
+
def test_is_valid_thpool_md_size(self):
"""Verify that is_valid_thpool_md_size works as expected"""
--
2.9.3