fabrics: Fix bad UUID size introduced in 71c25d1cf

Fix UUID problems

Resolves: #2158264

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
This commit is contained in:
John Meneghini 2023-01-12 15:14:06 -05:00
parent 8df65cb8ee
commit d99d70d226
2 changed files with 39 additions and 3 deletions

View File

@ -0,0 +1,33 @@
From 78ce3528d00bb433c661fd24672a1b5c6795b59f Mon Sep 17 00:00:00 2001
From: Martin Belanger <martin.belanger@dell.com>
Date: Fri, 18 Nov 2022 10:41:32 -0500
Subject: [PATCH] fabrics: Fix bad UUID size introduced in recent UUID changes
Content-type: text/plain
71c25d1cf741 ("util: Add simple UUID type") introduced a regression in
nvmf_get_tel(). nvmf_get_tel() returns the lenght of the binary
representation. Hence use NVME_UUID_LEN instead.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: massaged commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
src/nvme/fabrics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c
index f943090..36bdc2d 100644
--- a/src/nvme/fabrics.c
+++ b/src/nvme/fabrics.c
@@ -1127,7 +1127,7 @@ static __u32 nvmf_get_tel(const char *hostsymname)
__u16 len;
/* Host ID is mandatory */
- tel += nvmf_exat_size(NVME_UUID_LEN_STRING);
+ tel += nvmf_exat_size(NVME_UUID_LEN);
/* Symbolic name is optional */
len = hostsymname ? strlen(hostsymname) : 0;
--
2.31.1

View File

@ -4,17 +4,17 @@
Name: libnvme
Summary: Linux-native nvme device management library
Version: 1.2
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
URL: https://github.com/linux-nvme/libnvme
Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
Patch0: 0001-fabrics-Fix-bad-UUID-size-introduced-in-recent-UUID-.patch
BuildRequires: gcc gcc-c++
BuildRequires: swig
BuildRequires: python3-devel
BuildRequires: meson >= 0.48.0
BuildRequires: libuuid-devel
BuildRequires: json-c-devel >= 0.13
BuildRequires: openssl-devel
@ -93,6 +93,9 @@ mv %{buildroot}/usr/*.rst %{buildroot}%{_pkgdocdir}/
%{python3_sitearch}/libnvme/*
%changelog
* Thu Jan 12 2023 John Meneghini <jmeneghi@redhat.com> - 1.2-2
- Fix BZ2158264
* Fri Nov 04 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.2-1
- Update to upstream version v1.2