From f209b60b064ed79b073e9096f57a8180cd6509ca Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Thu, 27 Jun 2024 15:08:42 +0200 Subject: [PATCH] RHEL 10.0 Beta fixes - tests: Try waiting after partition creation for XFS resize test Resolves: RHEL-45177 - Run mkfs.xfs with the force (-f) option by default Resolves: RHEL-39384 --- 0003-XFS-resize-test-fix.patch | 32 ++++++++++++++ ...kfs-xfs-with-force-option-by-default.patch | 43 +++++++++++++++++++ python-blivet.spec | 10 ++++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 0003-XFS-resize-test-fix.patch create mode 100644 0004-Run-mkfs-xfs-with-force-option-by-default.patch diff --git a/0003-XFS-resize-test-fix.patch b/0003-XFS-resize-test-fix.patch new file mode 100644 index 0000000..b36d8c6 --- /dev/null +++ b/0003-XFS-resize-test-fix.patch @@ -0,0 +1,32 @@ +From b7940496b4f8efdccb9b4097b496b0d9b2af1eea Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 18 Jun 2024 14:47:39 +0200 +Subject: [PATCH] tests: Try waiting after partition creation for XFS resize + test + +The test randomly fails to find the newly created partition so +lets try waiting a bit with udev settle. +--- + tests/storage_tests/formats_test/fs_test.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/storage_tests/formats_test/fs_test.py b/tests/storage_tests/formats_test/fs_test.py +index f3c9fef5a..5da4a9339 100644 +--- a/tests/storage_tests/formats_test/fs_test.py ++++ b/tests/storage_tests/formats_test/fs_test.py +@@ -11,6 +11,7 @@ + from blivet.devices import PartitionDevice, DiskDevice + from blivet.flags import flags + from blivet.util import capture_output ++from blivet import udev + + from .loopbackedtestcase import LoopBackedTestCase + +@@ -149,6 +150,7 @@ def _create_partition(self, disk, size): + pend = pstart + int(Size(size) / disk.format.parted_device.sectorSize) + disk.format.add_partition(pstart, pend, parted.PARTITION_NORMAL) + disk.format.parted_disk.commit() ++ udev.settle() + part = disk.format.parted_disk.getPartitionBySector(pstart) + + device = PartitionDevice(os.path.basename(part.path)) diff --git a/0004-Run-mkfs-xfs-with-force-option-by-default.patch b/0004-Run-mkfs-xfs-with-force-option-by-default.patch new file mode 100644 index 0000000..5473e05 --- /dev/null +++ b/0004-Run-mkfs-xfs-with-force-option-by-default.patch @@ -0,0 +1,43 @@ +From 52c9699ecad592e35e0cd3841744f8cb8e2b2364 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 12 Jun 2024 16:51:43 +0200 +Subject: [PATCH] Run mkfs.xfs with the force (-f) option by default + +We stopped adding the force option when switching to libblockdev +in fa3add214ba8edf1965bc851b85f2f2a6a3ea107. This was not +intentional and the missing force option is already causing issues +when running mkfs.xfs on misaligned devices. +--- + blivet/tasks/fsmkfs.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py +index 096b02295..45314ea89 100644 +--- a/blivet/tasks/fsmkfs.py ++++ b/blivet/tasks/fsmkfs.py +@@ -241,6 +241,7 @@ class FSBlockDevMkfs(task.BasicApplication, FSMkfsTask, metaclass=abc.ABCMeta): + can_set_uuid = False + can_label = False + fstype = None ++ force = False + + def do_task(self, options=None, label=False, set_uuid=False, nodiscard=False): + """Create the format on the device and label if possible and desired. +@@ -277,7 +278,8 @@ def do_task(self, options=None, label=False, set_uuid=False, nodiscard=False): + try: + bd_options = BlockDev.FSMkfsOptions(label=self.fs.label if label else None, + uuid=self.fs.uuid if set_uuid else None, +- no_discard=self.fs._mkfs_nodiscard if nodiscard else False) ++ no_discard=self.fs._mkfs_nodiscard if nodiscard else False, ++ force=self.force) + BlockDev.fs.mkfs(self.fs.device, self.fstype, bd_options, extra={k: '' for k in create_options}) + except BlockDev.FSError as e: + raise FSError(str(e)) +@@ -331,6 +333,7 @@ class XFSMkfs(FSBlockDevMkfs): + can_nodiscard = True + can_set_uuid = True + can_label = True ++ force = True + + + class F2FSMkfs(FSBlockDevMkfs): diff --git a/python-blivet.spec b/python-blivet.spec index 799d647..26bb7d5 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,7 +5,7 @@ Version: 3.10.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 3%{?prerelease}%{?dist} +Release: 4%{?prerelease}%{?dist} Epoch: 1 License: LGPL-2.1-or-later %global realname blivet @@ -18,6 +18,8 @@ Patch0: 0001-remove-btrfs-plugin.patch %endif Patch1: 0002-Fix-skipping-btrfs-calls-when-libblockdev-btrfs-plugin-is-missing.patch +Patch2: 0003-XFS-resize-test-fix.patch +Patch3: 0004-Run-mkfs-xfs-with-force-option-by-default.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -115,6 +117,12 @@ make DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Thu Jun 27 2024 Vojtech Trefny - 3.10.0-4 +- tests: Try waiting after partition creation for XFS resize test + Resolves: RHEL-45177 +- Run mkfs.xfs with the force (-f) option by default + Resolves: RHEL-39384 + * Mon Jun 24 2024 Troy Dawson - 1:3.10.0-3 - Bump release for June 2024 mass rebuild