From e6f57b5bd5b1b962d153db7e1a3adaaf596daac6 Mon Sep 17 00:00:00 2001 From: sun_hai_10 Date: Mon, 15 Apr 2024 12:17:56 +0800 Subject: [PATCH] Ignore invalid/empty UUIDs for NVMe namespaces (cherry picked from commit cc78983fd6d7c0b3012a34871e63de2bcdf363f2) --- ...alid-empty-UUIDs-for-NVMe-namespaces.patch | 41 +++++++++++++++++++ python-blivet.spec | 10 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch diff --git a/backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch b/backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch new file mode 100644 index 0000000..0231199 --- /dev/null +++ b/backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch @@ -0,0 +1,41 @@ +From 8f61c9ba7241daa6b068355eafb39b1711b12371 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 10 Apr 2024 13:41:35 +0200 +Subject: [PATCH] Ignore invalid/empty UUIDs for NVMe namespaces + +Fixes: #1221 +--- + blivet/populator/helpers/disk.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/blivet/populator/helpers/disk.py b/blivet/populator/helpers/disk.py +index 4a7daa1d1..3ac3f4089 100644 +--- a/blivet/populator/helpers/disk.py ++++ b/blivet/populator/helpers/disk.py +@@ -27,6 +27,8 @@ + from gi.repository import BlockDev as blockdev + from gi.repository import GLib + ++import uuid ++ + from ... import udev + from ... import util + from ...devices import DASDDevice, DiskDevice, FcoeDiskDevice, iScsiDiskDevice +@@ -257,10 +259,14 @@ def _get_kwargs(self): + log.debug("Failed to get namespace info for %s: %s", path, str(err)) + else: + kwargs["nsid"] = ninfo.nsid +- kwargs["uuid"] = ninfo.uuid + kwargs["eui64"] = ninfo.eui64 + kwargs["nguid"] = ninfo.nguid + ++ if ninfo.uuid and ninfo.uuid != uuid.UUID(int=0): ++ kwargs["uuid"] = ninfo.uuid ++ else: ++ kwargs["uuid"] = None ++ + log.info("%s is an NVMe local namespace device", udev.device_get_name(self.data)) + return kwargs + + -- +2.27.0 \ No newline at end of file diff --git a/python-blivet.spec b/python-blivet.spec index 86b0cf2..dee2357 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.8.2 -Release: 3 +Release: 4 Epoch: 1 Summary: A python module for system storage configuration License: LGPL-2.1-or-later @@ -24,6 +24,8 @@ patch9001: blivet-3.4.2-sw.patch %endif patch9002: Incomplete-Chineseization-of-disk-mount.patch +patch6001: backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch + %description The python-blivet package is a python module for examining and modifying storage configuration. @@ -124,6 +126,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README.md %changelog +* Mon Apr 15 2024 sunhai - 1:3.8.2-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Ignore invalid/empty UUIDs for NVMe namespaces + * Tue Mar 26 2024 sunhai - 1:3.8.2-3 - Type:bugfix - ID:NA -- Gitee