Merge pull request #3183 from flatcar/chewi/overlaybd-pin-tcmu

sys-fs/overlaybd: Update patches following upstream merge and pin TCMU
This commit is contained in:
James Le Cuirot 2025-08-12 16:13:22 +01:00 committed by GitHub
commit 1cfb95490c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 73 deletions

View File

@ -126,29 +126,3 @@ Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
if(BUILD_TESTING) if(BUILD_TESTING)
-- --
2.49.0 2.49.0
From 32a592ef523a14600ce658a695d827724aeb66c9 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Fri, 8 Aug 2025 16:47:58 +0200
Subject: [PATCH] Patch libtcmu after fetching to fix memory issues
---
CMake/Findtcmu.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMake/Findtcmu.cmake b/CMake/Findtcmu.cmake
index 6e8f0ef..5865a9b 100644
--- a/CMake/Findtcmu.cmake
+++ b/CMake/Findtcmu.cmake
@@ -5,6 +5,7 @@ FetchContent_Declare(
tcmu
GIT_REPOSITORY https://github.com/data-accelerator/photon-libtcmu.git
GIT_TAG main
+ PATCH_COMMAND patch -p1 -i @FILESDIR@/tcmu-fix.patch
)
if(BUILD_TESTING)
--
2.49.1

View File

@ -0,0 +1,11 @@
--- a/CMake/Findtcmu.cmake
+++ b/CMake/Findtcmu.cmake
@@ -4,7 +4,7 @@ set(FETCHCONTENT_QUIET false)
FetchContent_Declare(
tcmu
GIT_REPOSITORY https://github.com/data-accelerator/photon-libtcmu.git
- GIT_TAG main
+ GIT_TAG 813fd65361bb2f348726b9c41478a44211847614
)
if(BUILD_TESTING)

View File

@ -1,46 +0,0 @@
From 0ee2c928de51ef56376c4ab6528ca1e23c13c4a7 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Fri, 8 Aug 2025 16:29:52 +0200
Subject: [PATCH] fix
---
scsi.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scsi.cpp b/scsi.cpp
index d8c27a9..4c7f480 100644
--- a/scsi.cpp
+++ b/scsi.cpp
@@ -183,7 +183,7 @@ int tcmu_emulate_evpd_inquiry(
{
char data[512];
char *ptr, *p, *wwn;
- size_t len, used = 0;
+ size_t len, used = 4;
uint16_t *tot_len = (uint16_t*) &data[2];
uint32_t padding;
bool next;
@@ -207,7 +207,7 @@ int tcmu_emulate_evpd_inquiry(
ptr[3] = 8 + len + 1;
used += (uint8_t)ptr[3] + 4;
- ptr += used;
+ ptr += (uint8_t)ptr[3] + 4;
/* 2/5: NAA binary */
ptr[0] = 1; /* code set: binary */
@@ -340,9 +340,9 @@ int tcmu_emulate_evpd_inquiry(
finish_page83:
/* Done with descriptor list */
- *tot_len = htobe16(used);
+ *tot_len = htobe16(used - 4);
- tcmu_memcpy_into_iovec(iovec, iov_cnt, data, used + 4);
+ tcmu_memcpy_into_iovec(iovec, iov_cnt, data, used);
free(wwn);
wwn = NULL;
--
2.49.1

View File

@ -49,7 +49,7 @@ PATCHES=(
src_prepare() { src_prepare() {
cmake_src_prepare cmake_src_prepare
sed -i "s:@FILESDIR@:${FILESDIR}:g" CMake/Findphoton.cmake CMake/Findtcmu.cmake || die sed -i "s:@FILESDIR@:${FILESDIR}:g" CMake/Findphoton.cmake || die
} }
src_configure() { src_configure() {