2 Commits

Author SHA256 Message Date
26d520c7b6 Accepting request 1299853 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1299853
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mhvtl?expand=0&rev=25
2025-08-15 19:52:54 +00:00
21098d5f7a - Update to version 1.72_release+13.928fc784016a (fixes factory issue):
* vtltape: Add ability to define LBP RSCRC byte order
  * mhvtl.ko: Update module version 0.18.36 will work with kernel 6.10+
  * kernel config: handle del_timer_sync() kABI rename
  * Fix external declarations of crc32c()
  * kernel config: put braces around debug stmnt
  * kernel config: replace fgrep with grep -F
  This removed these patches, as they are now upstream:
  * 0001-kernel-config-replace-fgrep-with-grep-F.patch
  * 0002-kernel-config-put-braces-around-debug-stmnt.patch
  * 0003-Fix-external-declarations-of-crc32c.patch
  * 0004-kernel-config-handle-del_timer_sync-kABI-rename.patch
  Also added and submitted upstream, to handle breakage in factory
  with newer kernel:
  * mhvtl-kernel-module-handle-rename-of-from_timer.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/mhvtl?expand=0&rev=48
2025-08-15 16:36:01 +00:00
10 changed files with 77 additions and 218 deletions

View File

@@ -1,46 +0,0 @@
From 3d320c937ceedc1e9b086328c553cc57d33a4bb9 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Tue, 3 Jun 2025 10:50:37 -0700
Subject: [PATCH 1/4] kernel config: replace fgrep with grep -F
fgrep is deprecated and can cause noise (messages)
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
kernel/config.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/config.sh b/kernel/config.sh
index da038ae3ed74..1bb32d2918e7 100755
--- a/kernel/config.sh
+++ b/kernel/config.sh
@@ -121,7 +121,7 @@ fi >> "${output}"
# check if scsi_host_template argument to scsi_host_alloc
# is const
#
-if fgrep -q 'extern struct Scsi_Host *scsi_host_alloc(const' \
+if grep -F -q 'extern struct Scsi_Host *scsi_host_alloc(const' \
"${hdrs}/scsi/scsi_host.h"; then
# the first argument to scsi_host_alloc needs to be a "const"
echo "#ifndef DEFINE_CONST_STRUCT_SCSI_HOST_TEMPLATE"
@@ -146,7 +146,7 @@ bus_type_def_file=$(grep -rl 'struct bus_type {' ${hdrs})
# Now check for the 2nd argument needs a "const"
if [ -r "$bus_type_def_file" ] &&
- fgrep -q "$pat" "$bus_type_def_file"; then
+ grep -F -q "$pat" "$bus_type_def_file"; then
# the second argument needs a "const" definition
echo "#ifndef DEFINE_CONST_STRUCT_DEVICE_DRIVER"
echo "#define DEFINE_CONST_STRUCT_DEVICE_DRIVER"
@@ -159,7 +159,7 @@ fi >> "${output}"
# check if slave_configure has been renamed to sdev_configure
#
pat='int (* sdev_configure)(struct scsi_device *, struct queue_limits *lim);'
-if fgrep -q "$pat" "${hdrs}/scsi/scsi_host.h"; then
+if grep -F -q "$pat" "${hdrs}/scsi/scsi_host.h"; then
echo "#ifndef DEFINE_QUEUE_LIMITS_SCSI_DEV_CONFIGURE"
echo "#define DEFINE_QUEUE_LIMITS_SCSI_DEV_CONFIGURE"
echo "#endif"
--
2.43.0

View File

@@ -1,36 +0,0 @@
From 4d4ee09b0e4c29e9992db6185509c65e472bd360 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Tue, 3 Jun 2025 10:52:48 -0700
Subject: [PATCH 2/4] kernel config: put braces around debug stmnt
In some cases this code:
> if (cmd)
> MHVTL_DBG_PRT_CDB(1, serial_number, cmd, SCpnt->cmd_len);
Can causee issues because the debug macro translates to being empty.
So put braces around the debug print statement.
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
kernel/mhvtl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/mhvtl.c b/kernel/mhvtl.c
index 6e1b707bdb4e..983d7db91e23 100644
--- a/kernel/mhvtl.c
+++ b/kernel/mhvtl.c
@@ -597,8 +597,9 @@ static int _mhvtl_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
if (done == NULL)
return 0; /* assume mid level reprocessing command */
- if (cmd)
+ if (cmd) {
MHVTL_DBG_PRT_CDB(1, serial_number, cmd, SCpnt->cmd_len);
+ }
if (SCpnt->device->id == mhvtl_driver_template.this_id) {
pr_err("initiator's id used as target!\n");
--
2.43.0

View File

@@ -1,46 +0,0 @@
From be40f77c7d1b7236ae49be61763b6f9016be9ed7 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 4 Jun 2025 08:00:05 -0700
Subject: [PATCH 3/4] Fix external declarations of crc32c()
The function uses the last (3rd) argument of
for size ("sz"), and it should be declared as
size_t, not int, as is done elsewhere.
This fixes a warning about mismatched declarations.
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
usr/ssc.c | 2 +-
usr/validate_crc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/ssc.c b/usr/ssc.c
index 6bc17281d2ff..c67a5e16919e 100644
--- a/usr/ssc.c
+++ b/usr/ssc.c
@@ -2332,7 +2332,7 @@ uint8_t ssc_recv_diagnostics(struct scsi_cmd *cmd)
}
uint32_t GenerateRSCRC(uint32_t seed, int sz, const uint8_t *buf);
-uint32_t crc32c(uint32_t seed, const uint8_t *buf, int sz);
+uint32_t crc32c(uint32_t seed, const uint8_t *buf, size_t sz);
uint8_t ssc_send_diagnostics(struct scsi_cmd *cmd)
{
diff --git a/usr/validate_crc.c b/usr/validate_crc.c
index 1405b8a5d4c0..d26f685c1e5b 100644
--- a/usr/validate_crc.c
+++ b/usr/validate_crc.c
@@ -13,7 +13,7 @@
#include <assert.h>
#include <inttypes.h>
-uint32_t crc32c(uint32_t seed, const uint8_t *buf, int sz);
+uint32_t crc32c(uint32_t seed, const uint8_t *buf, size_t sz);
uint32_t GenerateRSCRC(uint32_t seed, int sz, const uint8_t *buf);
int main(int argc, char *argv[])
--
2.43.0

View File

@@ -1,81 +0,0 @@
From ad0ad22e21a470981a801ddf2a14e5165431f88a Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 4 Jun 2025 09:45:39 -0700
Subject: [PATCH 4/4] kernel config: handle del_timer_sync() kABI rename
In newer kernels (starting with 6.10), the del_timer_sync()
kABI has been replaced/renamed to timer_delete_sync().
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
kernel/config.sh | 11 +++++++++++
kernel/mhvtl.c | 15 ++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/kernel/config.sh b/kernel/config.sh
index 1bb32d2918e7..2c9da68d6eb6 100755
--- a/kernel/config.sh
+++ b/kernel/config.sh
@@ -167,4 +167,15 @@ else
echo "#undef DEFINE_QUEUE_LIMITS_SCSI_DEV_CONFIGURE"
fi >> "${output}"
+#
+# check if del_timer_sync() has been renamed to timer_delete()
+#
+if grep -F -q 'int timer_delete_sync(' "${hdrs}/linux/timer.h"; then
+ echo "#ifndef USE_TIMER_DELETE_NOT_DEL_TIMER"
+ echo "#define USE_TIMER_DELETE_NOT_DEL_TIMER"
+ echo "#endif"
+else
+ echo "#undef USE_TIMER_DELETE_NOT_DEL_TIMER"
+fi >> "${output}"
+
printf '\n\n#endif /* _MHVTL_KERNEL_CONFIG_H */\n' >> "${output}"
diff --git a/kernel/mhvtl.c b/kernel/mhvtl.c
index 983d7db91e23..8bfee8770221 100644
--- a/kernel/mhvtl.c
+++ b/kernel/mhvtl.c
@@ -1002,7 +1002,11 @@ static int mhvtl_stop_queued_cmnd(struct scsi_cmnd *SCpnt)
spin_lock_irqsave(&lu->cmd_list_lock, iflags);
list_for_each_entry_safe(sqcp, n, &lu->cmd_list, queued_sibling) {
if (sqcp->state && (SCpnt == sqcp->a_cmnd)) {
+#ifdef USE_TIMER_DELETE_NOT_DEL_TIMER
+ timer_delete_sync(&sqcp->cmnd_timer);
+#else
del_timer_sync(&sqcp->cmnd_timer);
+#endif
sqcp->state = CMD_STATE_FREE;
sqcp->a_cmnd = NULL;
found = 1;
@@ -1031,7 +1035,11 @@ static void mhvtl_stop_all_queued(void)
list_for_each_entry_safe(sqcp, n, &lu->cmd_list,
queued_sibling) {
if (sqcp->state && sqcp->a_cmnd) {
+#ifdef USE_TIMER_DELETE_NOT_DEL_TIMER
+ timer_delete_sync(&sqcp->cmnd_timer);
+#else
del_timer_sync(&sqcp->cmnd_timer);
+#endif
sqcp->state = CMD_STATE_FREE;
sqcp->a_cmnd = NULL;
__mhvtl_remove_sqcp(sqcp);
@@ -1599,9 +1607,14 @@ static int mhvtl_put_user_data(unsigned int minor, char __user *arg)
s[2],
s[12],
s[13]);
- } else
+ } else {
sqcp->a_cmnd->result = DID_OK << 16;
+ }
+#ifdef USE_TIMER_DELETE_NOT_DEL_TIMER
+ timer_delete_sync(&sqcp->cmnd_timer);
+#else
del_timer_sync(&sqcp->cmnd_timer);
+#endif
if (sqcp->done_funct)
sqcp->done_funct(sqcp->a_cmnd);
else
--
2.43.0

View File

@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/markh794/mhvtl.git</param>
<param name="changesrevision">a11b6777660b969318bd1b849203164fcbae3eca</param></service></servicedata>
<param name="changesrevision">928fc784016a8dd375a85dedcbee5356fe3a3ef2</param></service></servicedata>

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c34a64ed397ba7b34bfef0d97221f6d378c9dbe977d898c6f48c55ef7b9e0dad
size 253944

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad9a93f3456634f13e9de9630da12a26100e0c4ff11187acd12c1a7ff8778943
size 253560

View File

@@ -0,0 +1,52 @@
From 27f03b01360050d3d95997fa70e845a949d5153c Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 13 Aug 2025 11:03:40 -0700
Subject: [PATCH] kernel module: handle rename of from_timer()
This is a 6.16 kernel change, from "from_timer()" to
"timer_container_of()" in timer.h.
---
kernel/config.sh | 11 +++++++++++
kernel/mhvtl.c | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/kernel/config.sh b/kernel/config.sh
index 2c9da68d6eb6..a0a95cf25d45 100755
--- a/kernel/config.sh
+++ b/kernel/config.sh
@@ -178,4 +178,15 @@ else
echo "#undef USE_TIMER_DELETE_NOT_DEL_TIMER"
fi >> "${output}"
+#
+# has "from_timer()" been renamed to "timer_container_of()"?
+#
+if grep -F -q 'timer_container_of(' "${hdrs}/linux/timer.h"; then
+ echo "#ifndef FROM_TIMER_NOW_TIMER_CONTAINER_OF"
+ echo "#define FROM_TIMER_NOW_TIMER_CONTAINER_OF"
+ echo "#endif"
+else
+ echo "#undef FROM_TIMER_NOW_TIMER_CONTAINER_OF"
+fi >> "${output}"
+
printf '\n\n#endif /* _MHVTL_KERNEL_CONFIG_H */\n' >> "${output}"
diff --git a/kernel/mhvtl.c b/kernel/mhvtl.c
index 5c7efdc35036..eb94db9b4836 100644
--- a/kernel/mhvtl.c
+++ b/kernel/mhvtl.c
@@ -791,7 +791,12 @@ static void mhvtl_remove_sqcp(struct mhvtl_lu_info *lu, struct mhvtl_queued_cmd
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
static void mhvtl_timer_intr_handler(struct timer_list *t)
{
+#ifdef FROM_TIMER_NOW_TIMER_CONTAINER_OF
+ struct mhvtl_queued_cmd *sqcp = timer_container_of(sqcp, t,
+ cmnd_timer);
+#else
struct mhvtl_queued_cmd *sqcp = from_timer(sqcp, t, cmnd_timer);
+#endif
unsigned long long indx = sqcp->serial_number;
#else
static void mhvtl_timer_intr_handler(unsigned long indx)
--
2.50.1

View File

@@ -1,3 +1,22 @@
-------------------------------------------------------------------
Wed Aug 13 20:07:38 UTC 2025 - lduncan@suse.com
- Update to version 1.72_release+13.928fc784016a:
* vtltape: Add ability to define LBP RSCRC byte order
* mhvtl.ko: Update module version 0.18.36 will work with kernel 6.10+
* kernel config: handle del_timer_sync() kABI rename
* Fix external declarations of crc32c()
* kernel config: put braces around debug stmnt
* kernel config: replace fgrep with grep -F
This removed these patches, as they are now upstream:
* 0001-kernel-config-replace-fgrep-with-grep-F.patch
* 0002-kernel-config-put-braces-around-debug-stmnt.patch
* 0003-Fix-external-declarations-of-crc32c.patch
* 0004-kernel-config-handle-del_timer_sync-kABI-rename.patch
Also added and submitted upstream, to handle breakage in factory
with newer kernel:
* mhvtl-kernel-module-handle-rename-of-from_timer.patch
-------------------------------------------------------------------
Tue Jun 03 18:16:05 UTC 2025 - lduncan@suse.com

View File

@@ -26,7 +26,7 @@
Name: mhvtl
URL: http://sites.google.com/site/linuxvtl2/
Version: 1.72_release+6.a11b6777660b
Version: 1.72_release+13.928fc784016a
Release: 0
Requires: mhvtl-kmp
Requires: module-init-tools
@@ -47,10 +47,7 @@ License: GPL-2.0-only
Group: System/Daemons
Source: %{name}-%{version}.tar.xz
Source2: %{name}.preamble
Patch1: 0001-kernel-config-replace-fgrep-with-grep-F.patch
Patch2: 0002-kernel-config-put-braces-around-debug-stmnt.patch
Patch3: 0003-Fix-external-declarations-of-crc32c.patch
Patch4: 0004-kernel-config-handle-del_timer_sync-kABI-rename.patch
Patch1: mhvtl-kernel-module-handle-rename-of-from_timer.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_ordering}