Package: tcmu
Version: 1.5.2-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu focal ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * Resolve issues with compilation on 32 bit architectures:
    - d/p/32bit-size_t-cast.patch: Ensure same type comparison
      avoiding compilation error.
    - d/p/Disable-Werror.patch: Drop, no longer needed.

This avoids the need to disable -Werror universally for all builds.

Thanks for considering the patch.


-- System Information:
Debian Release: bullseye/sid
  APT prefers focal
  APT policy: (500, 'focal')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.3.0-19-generic (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru tcmu-1.5.2/debian/patches/32bit-size_t-cast.patch 
tcmu-1.5.2/debian/patches/32bit-size_t-cast.patch
--- tcmu-1.5.2/debian/patches/32bit-size_t-cast.patch   1970-01-01 
01:00:00.000000000 +0100
+++ tcmu-1.5.2/debian/patches/32bit-size_t-cast.patch   2019-12-09 
10:42:11.000000000 +0000
@@ -0,0 +1,19 @@
+Description: Case return of tcmu_lba_to_byte to size_t
+ Ensures comparison of size_t types avoiding compilation
+ error under 32 bit architectures.
+Author: James Page <[email protected]>
+Forwarded: https://github.com/open-iscsi/tcmu-runner/pull/603
+
+diff --git a/tcmur_cmd_handler.c b/tcmur_cmd_handler.c
+index 132c668..a68e367 100644
+--- a/tcmur_cmd_handler.c
++++ b/tcmur_cmd_handler.c
+@@ -725,7 +725,7 @@ static int handle_writesame(struct tcmu_device *dev, 
struct tcmulib_cmd *cmd)
+ 
+       max_xfer_length = tcmu_dev_get_max_xfer_len(dev) * block_size;
+       length = round_up(length, max_xfer_length);
+-      length = min(length, tcmu_lba_to_byte(dev, lba_cnt));
++      length = min(length, (size_t)tcmu_lba_to_byte(dev, lba_cnt));
+ 
+       if (tcmur_cmd_state_init(tcmur_cmd, sizeof(*write_same), length)) {
+               tcmu_dev_err(dev, "Failed to calloc write_same data!\n");
diff -Nru tcmu-1.5.2/debian/patches/Disable-Werror.patch 
tcmu-1.5.2/debian/patches/Disable-Werror.patch
--- tcmu-1.5.2/debian/patches/Disable-Werror.patch      2019-10-21 
13:39:15.000000000 +0100
+++ tcmu-1.5.2/debian/patches/Disable-Werror.patch      1970-01-01 
01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= <[email protected]>
-Date: Mon, 21 Oct 2019 14:31:53 +0200
-Subject: Disable Werror
-
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index da21689..7618eb5 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,7 +1,7 @@
- cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
- project (tcmu-runner C)
- set(VERSION 1.5.2)
--set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall 
-Wdeclaration-after-statement -std=c99")
-+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wdeclaration-after-statement 
-std=c99")
- 
- include(GNUInstallDirs)
- include(CheckIncludeFile)
diff -Nru tcmu-1.5.2/debian/patches/series tcmu-1.5.2/debian/patches/series
--- tcmu-1.5.2/debian/patches/series    2019-10-21 13:39:15.000000000 +0100
+++ tcmu-1.5.2/debian/patches/series    2019-12-09 10:40:48.000000000 +0000
@@ -1 +1 @@
-Disable-Werror.patch
+32bit-size_t-cast.patch

Reply via email to