diff --git a/0008-Fix-passing-size-for-pvresize-over-DBus.patch b/0008-Fix-passing-size-for-pvresize-over-DBus.patch new file mode 100644 index 0000000000000000000000000000000000000000..2cfdf77b259ac721c4469044a370bb559b703679 --- /dev/null +++ b/0008-Fix-passing-size-for-pvresize-over-DBus.patch @@ -0,0 +1,69 @@ +From 7afe64265c9fc6ac67bfc412e43d00e5a21c867a Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Fri, 22 Mar 2024 14:54:15 +0100 +Subject: [PATCH] lvm-dbus: Fix passing size for pvresize over DBus + +"u" is UINT32, we need to use "t" for UINT64 + +--- + src/plugins/lvm-dbus.c | 2 +- + tests/lvm_dbus_tests.py | 6 ++++++ + tests/lvm_test.py | 6 ++++++ + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c +index ca082f4..d731f76 100644 +--- a/src/plugins/lvm-dbus.c ++++ b/src/plugins/lvm-dbus.c +@@ -1772,7 +1772,7 @@ gboolean bd_lvm_pvresize (const gchar *device, guint64 size, const BDExtraArg ** + if (!obj_path) + return FALSE; + +- params = g_variant_new ("(u)", size); ++ params = g_variant_new ("(t)", size); + return call_lvm_method_sync (obj_path, PV_INTF, "ReSize", params, NULL, extra, TRUE, error); + } + +diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py +index 327211d..fc270cb 100644 +--- a/tests/lvm_dbus_tests.py ++++ b/tests/lvm_dbus_tests.py +@@ -430,9 +430,15 @@ class LvmTestPVresize(LvmPVonlyTestCase): + succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**2, None) + self.assertTrue(succ) + ++ info = BlockDev.lvm_pvinfo(self.loop_dev) ++ self.assertEqual(info.pv_size, 200 * 1024**2) ++ + succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**3, None) + self.assertTrue(succ) + ++ info = BlockDev.lvm_pvinfo(self.loop_dev) ++ self.assertEqual(info.pv_size, 200 * 1024**3) ++ + @unittest.skipUnless(lvm_dbus_running, "LVM DBus not running") + class LvmTestPVscan(LvmPVonlyTestCase): + def test_pvscan(self): +diff --git a/tests/lvm_test.py b/tests/lvm_test.py +index 3a7ed2e..a39a0a6 100644 +--- a/tests/lvm_test.py ++++ b/tests/lvm_test.py +@@ -440,9 +440,15 @@ class LvmTestPVresize(LvmPVonlyTestCase): + succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**2, None) + self.assertTrue(succ) + ++ info = BlockDev.lvm_pvinfo(self.loop_dev) ++ self.assertEqual(info.pv_size, 200 * 1024**2) ++ + succ = BlockDev.lvm_pvresize(self.loop_dev, 200 * 1024**3, None) + self.assertTrue(succ) + ++ info = BlockDev.lvm_pvinfo(self.loop_dev) ++ self.assertEqual(info.pv_size, 200 * 1024**3) ++ + class LvmTestPVscan(LvmPVonlyTestCase): + def test_pvscan(self): + """Verify that pvscan runs without issues with cache or without""" +-- +2.27.0 + diff --git a/libblockdev.spec b/libblockdev.spec index c4615f1cd59e2eaab8b6555d13b7db4ac508a3d0..d5dd42c2c4f5ba358766be7dfec43f0388d3d47f 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -3,7 +3,7 @@ Name: libblockdev Version: 3.0.4 -Release: 9 +Release: 10 Summary: libblockdev is a C library supporting GObject introspection for manipulation of block devices License: LGPLv2+ URL: https://github.com/storaged-project/libblockdev @@ -16,6 +16,7 @@ Patch4: 0004-nvme-Fix-potential-memory-leak.patch Patch5: 0005-part-Fix-potential-double-free-when-getting-parttype.patch Patch6: 0006-crypto-Fix-double-free-in-bd_crypto_luks_remove_key.patch Patch7: 0007-part-Fix-copy-paste-bug-in-bd_part_spec_copy.patch +Patch8: 0008-Fix-passing-size-for-pvresize-over-DBus.patch BuildRequires: make glib2-devel libyaml-devel libbytesize-devel parted-devel libuuid-devel ndctl-devel device-mapper-devel BuildRequires: device-mapper-devel systemd-devel nss-devel volume_key-devel >= 0.3.9-7 libblkid-devel libmount-devel @@ -165,6 +166,12 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %changelog +* Wed Sep 25 2024 yanshuai - 3.0.4-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:lvm-dbus: Fix passing size for pvresize over DBus + * Mon Aug 5 2024 cenhuilin - 3.0.4-9 - Type:bugfix - ID:NA