Skip to content

Commit

Permalink
Merge pull request #17 from truenas/rebase_on_upstream_master
Browse files Browse the repository at this point in the history
NAS-126805 / 24.04 / Rebase on upstream master
  • Loading branch information
bmeagherix authored Jan 16, 2024
2 parents a5371a3 + 2f9a82b commit c453967
Show file tree
Hide file tree
Showing 35 changed files with 211 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mail_notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Mailing list
on:
push:
branches:
- 3.7.x
- 3.8.x
- master

jobs:
Expand Down
2 changes: 1 addition & 1 deletion doc/scst_user_spec.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SCST user space device handler interface description
<name>Vladislav Bolkhovitin</name>
</author>

<date>Version 3.8.0-pre</date>
<date>Version 3.9.0-pre</date>

<toc>

Expand Down
2 changes: 1 addition & 1 deletion fcst/fcst.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define NEW_LIBFC_API
#endif

#define FT_VERSION "3.8.0-pre"
#define FT_VERSION "3.9.0-pre"
#define FT_MODULE "fcst"

#define FT_MAX_HW_PENDING_TIME 20 /* max I/O time in seconds */
Expand Down
2 changes: 1 addition & 1 deletion iscsi-scst/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
iSCSI SCST target driver
========================

Version 3.8.0-pre, 28 December 2022
Version 3.9.0-pre, 15 January 2024
----------------------------

ISCSI-SCST is a deeply reworked fork of iSCSI Enterprise Target (IET)
Expand Down
2 changes: 1 addition & 1 deletion iscsi-scst/include/iscsi_scst_ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

#define ISCSI_VERSION_STRING_SUFFIX

#define ISCSI_VERSION_STRING "3.8.0-pre" ISCSI_VERSION_STRING_SUFFIX
#define ISCSI_VERSION_STRING "3.9.0-pre" ISCSI_VERSION_STRING_SUFFIX
4 changes: 2 additions & 2 deletions iscsi-scst/kernel/isert-scst/isert.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ static int __init isert_init_module(void)
MODULE_AUTHOR("Yan Burman");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_IMPORT_NS(SCST);
#define DRV_VERSION "3.8.0-pre" "#" __stringify(OFED_FLAVOR)
#define DRV_RELDATE "28 December 2022"
#define DRV_VERSION "3.9.0-pre" "#" __stringify(OFED_FLAVOR)
#define DRV_RELDATE "15 January 2024"
MODULE_DESCRIPTION("iSER target transport driver "
"v" DRV_VERSION " (" DRV_RELDATE ")");
module_init(isert_init_module);
Expand Down
4 changes: 3 additions & 1 deletion iscsi-scst/kernel/isert-scst/isert_login.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,9 @@ int __init isert_init_login_devs(unsigned int ndevs)
goto fail; /* Make this more graceful */
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
isert_class = class_create(THIS_MODULE, "isert_scst");
#else
isert_class = class_create("isert_scst");
Expand Down
30 changes: 17 additions & 13 deletions nightly/conf/nightly.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,41 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
6.5.4 \
6.7 \
6.6.11-nc \
6.5.13-nc \
6.4.16-nc \
6.3.13-nc \
6.2.16-nc \
6.1.54-nc \
6.1.72-nc \
6.0.19-nc \
5.19.17-nc \
5.18.19-nc \
5.17.15-nc \
5.16.20-nc \
5.15.132-nc \
5.15.146-nc \
5.14.21-nc \
5.13.19-nc \
5.12.19-nc \
5.11.22-nc \
5.10.195-nc \
5.10.206-nc \
5.9.16-nc \
5.8.18-nc \
5.7.19-nc \
5.6.19-nc \
5.5.19-nc \
5.4.256-nc \
5.4.266-nc \
5.3.18-nc \
5.2.21-nc \
5.1.21-nc \
5.0.21-nc \
4.20.17-nc \
4.19.294-nc \
4.19.304-nc \
4.18.20-nc \
4.17.19-nc \
4.16.18-nc \
4.15.18-nc \
4.14.325-nc \
4.14.336-nc \
4.13.16-nc \
4.12.14-nc \
4.11.12-nc \
Expand All @@ -60,10 +62,12 @@ ABT_KERNELS=" \
3.12.74-nc \
3.11.10-nc \
3.10.108-nc \
5.14.0-362.13.1.el9_3^AlmaLinux^9.3-nc \
5.14.0-284.30.1.el9_2^AlmaLinux^9.2-nc \
5.14.0-162.23.1.el9_1^AlmaLinux^9.1-nc \
5.14.0-70.30.1.el9_0^AlmaLinux^9.0-nc \
4.18.0-477.21.1.el8_8^AlmaLinux^8.8-nc \
4.18.0-513.5.1.el8_9^AlmaLinux^8.9-nc \
4.18.0-477.13.1.el8_8^AlmaLinux^8.8-nc \
4.18.0-425.19.2.el8_7^AlmaLinux^8.7-nc \
4.18.0-372.32.1.el8_6^AlmaLinux^8.6-nc \
4.18.0-348.2.1.el8_5^CentOS^8.5.2111-nc \
Expand All @@ -72,18 +76,18 @@ ABT_KERNELS=" \
4.18.0-193.28.1.el8_2^CentOS^8.2.2004-nc \
4.18.0-147.8.1.el8_1^CentOS^8.1.1911-nc \
4.18.0-80.11.2.el8_0^CentOS^8.0.1905-nc \
3.10.0-1160.95.1.el7^CentOS^7.9.2009-nc \
3.10.0-1160.105.1.el7^CentOS^7.9.2009-nc \
3.10.0-1127.19.1.el7^CentOS^7.8.2003-nc \
3.10.0-1062.18.1.el7^CentOS^7.7.1908-nc \
3.10.0-957.27.2.el7^CentOS^7.6.1810-nc \
3.10.0-862.14.4.el7^CentOS^7.5.1804-nc \
5.15.0-105.125.6.2.1.el9uek^UEK^9-nc \
5.15.0-105.125.6.2.1.el8uek^UEK^8-nc \
5.4.17-2136.323.8.1.el8uek^UEK^8-nc \
5.15.0-201.135.6.el9uek^UEK^9-nc \
5.15.0-201.135.6.el8uek^UEK^8-nc \
5.4.17-2136.326.6.el8uek^UEK^8-nc \
5.4.17-2102.206.1.el8uek^UEK^8-nc \
5.4.17-2036.104.5.el8uek^UEK^8-nc \
5.4.17-2011.7.4.el8uek^UEK^8-nc \
5.4.17-2136.323.8.1.el7uek^UEK^7-nc \
5.4.17-2136.326.6.el7uek^UEK^7-nc \
5.4.17-2102.206.1.el7uek^UEK^7-nc \
5.4.17-2036.104.5.el7uek^UEK^7-nc \
5.4.17-2011.7.4.el7uek^UEK^7-nc \
Expand Down
4 changes: 2 additions & 2 deletions qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

/* Driver version number */
#define Q2T_VERSION(a, b, c, d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d))
#define Q2T_VERSION_CODE Q2T_VERSION(3, 8, 0, 0)
#define Q2T_VERSION_STRING "3.8.0-pre"
#define Q2T_VERSION_CODE Q2T_VERSION(3, 9, 0, 0)
#define Q2T_VERSION_STRING "3.9.0-pre"

#define SQA_DEFAULT_TAGS 2048

Expand Down
18 changes: 13 additions & 5 deletions qla2x00t-32gbit/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,13 +1877,21 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
}

spin_lock_irqsave(qp->qp_lock_ptr, *flags);
switch (sp->type) {
case SRB_SCSI_CMD:
#if HAVE_SCSI_MQ
if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd)))
sp->done(sp, res);
if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd)))
sp->done(sp, res);
#else
if (ret_cmd && list_empty(&cmd->request->queuelist))
sp->done(sp, res);
if (ret_cmd && list_empty(&cmd->request->queuelist))
sp->done(sp, res);
#endif
break;
default:
if (ret_cmd)
sp->done(sp, res);
break;
}
} else {
sp->done(sp, res);
}
Expand Down Expand Up @@ -5021,7 +5029,7 @@ qla2x00_mem_free(struct qla_hw_data *ha)
ha->gid_list = NULL;
ha->gid_list_dma = 0;

if (!list_empty(&ha->base_qpair->dsd_list)) {
if (ha->base_qpair && !list_empty(&ha->base_qpair->dsd_list)) {
struct dsd_dma *dsd_ptr, *tdsd_ptr;

/* clean up allocated prev pool */
Expand Down
2 changes: 1 addition & 1 deletion qla2x00t/qla2x00-target/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Target driver for QLogic 2[2-6]xx/8[1-3]xx Fibre Channel cards
==============================================================

Version 3.8.0-pre, 28 December 2022
Version 3.9.0-pre, 15 January 2024
----------------------------

This is target driver for QLogic 2[2-6]xx/8[1-3]xx Fibre Channel cards.
Expand Down
4 changes: 2 additions & 2 deletions qla2x00t/qla2x00-target/qla2x00t.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

/* Version numbers, the same as for the kernel */
#define Q2T_VERSION(a, b, c, d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d))
#define Q2T_VERSION_CODE Q2T_VERSION(3, 8, 0, 0)
#define Q2T_VERSION_STRING "3.8.0-pre"
#define Q2T_VERSION_CODE Q2T_VERSION(3, 9, 0, 0)
#define Q2T_VERSION_STRING "3.9.0-pre"
#define Q2T_PROC_VERSION_NAME "version"

#define Q2T_MAX_CDB_LEN 16
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-kernel-patch
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function specialize_patch {
fi
;;
UEK)
ao=(-v UEK_KABI_RENAME=1 -v UEK_RELEASE=${releasevermajor})
ao=(-v UEK_KABI_RENAME=1)
;;
esac
local kver3
Expand Down
7 changes: 3 additions & 4 deletions scripts/specialize-patch
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ function evaluate(stmnt, pattern, arg, op, result) {
"RHEL_RELEASE_CODE -0 < 7 * 256 + 5)", stmnt)

gsub("defined\\(IB_CM_LISTEN_TAKES_THIRD_ARG\\)",
"(LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))", stmnt)
"(LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) \\&\\& " \
"!(RHEL_MAJOR -0 == 8 \\&\\& RHEL_MINOR -0 >= 9 || " \
"RHEL_MAJOR -0 == 9 \\&\\& RHEL_MINOR -0 >= 3))", stmnt)

gsub("IB_CLIENT_ADD_ONE_RETURNS_INT",
"(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || " \
Expand Down Expand Up @@ -252,8 +254,6 @@ function evaluate(stmnt, pattern, arg, op, result) {

gsub("defined\\(_COMPAT_LINUX_MM_H\\)", "0", stmnt)
gsub("defined\\(UEK_KABI_RENAME\\)", UEK_KABI_RENAME ? "1" : "0", stmnt)
gsub("defined\\(UEK_RELEASE\\)", UEK_RELEASE ? "1" : "0", stmnt)
gsub("UEK_RELEASE", UEK_RELEASE ? UEK_RELEASE : "0", stmnt)

if (SCST_IO_CONTEXT != "")
{
Expand Down Expand Up @@ -460,7 +460,6 @@ function handle_if(evaluated)
|| $0 ~ "RHEL_RELEASE_CODE" \
|| $0 ~ "SOCK_RECVMSG_HAS_FOUR_ARGS" \
|| $0 ~ "UEK_KABI_RENAME" \
|| $0 ~ "UEK_RELEASE" \
|| $0 ~ "USE_PRE_440_WR_STRUCTURE" \
|| $0 ~ "_COMPAT_LINUX_MM_H" \
|| $0 ~ "bio_multiple_segments" \
Expand Down
28 changes: 28 additions & 0 deletions scst/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
Summary of changes between versions 3.7 and 3.8
-----------------------------------------------
- Fixed depmod warnings during the installation process.
- Resolved RPM build issues for Fedora and CentOS Stream kernels.
- Introduced selectable debug mode levels during package building by passing
PKG_BUILD_MODE=2[release, debug, perf] as an argument to make.
- scst_disk: Implemented cluster mode support.
- scst_vdisk: Introduced the lb_per_pb_exp attribute, allowing control over
whether READ CAPACITY 16 returns LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT.
- scst_vdisk: Enabled exclusive opening of block devices to prevent
concurrent usage.
- iscsi-scst: Implemented iSCSI TargetAlias support.
- iscsi-scstd: Added initiator name validation during login.
- Added the aen_disabled attribute, enabling forcible UA sending instead of
AEN from the target port.
- Fixed UNIT ATTENTION for remote PR registrants.
- Enhanced device blocking to ensure signal-induced waiting cancellation does
not crash the system.
- Corrected the display of the number of active commands during suspending.
- qla2x00t-32gbit driver: Rectified ABORT_TASK_SET processing.
- qla2x00t-32gbit driver: Updated from Linux kernel version v5.15 to v6.7.

The kernel versions supported by this release are:
* Kernel.org kernel versions v3.10..v6.7.
* Debian / Ubuntu kernels based on upstream kernel versions v3.10..v6.7.
* RHEL / CentOS / AlmaLinux 7.x, 8.0..8.9 and 9.0..9.3 kernels.
* UEK version 4, 5, 6 and 7 kernels.

Summary of changes between versions 3.6 and 3.7
-----------------------------------------------
- The SCST event subsystem works again reliably.
Expand Down
2 changes: 1 addition & 1 deletion scst/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Generic SCSI target mid-level for Linux (SCST)
==============================================

Version 3.8.0-pre, 28 December 2022
Version 3.9.0-pre, 15 January 2024
----------------------------

SCST is designed to provide unified, consistent interface between SCSI
Expand Down
36 changes: 26 additions & 10 deletions scst/include/backport.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ void blk_execute_rq_nowait_backport(struct request *rq, bool at_head)

/* <linux/blkdev.h> */

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
/*
* See also commit 05bdb9965305 ("block: replace fmode_t with a block-specific
* type for block open flags") # v6.5.
Expand Down Expand Up @@ -1619,13 +1621,21 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
!(LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(5, 4, 0) >> 8 && \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 263)) && \
!(LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(5, 10, 0) >> 8 && \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 203)) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \
RHEL_RELEASE_CODE -0 == RHEL_RELEASE_VERSION(9, 0))
/*
* See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq()
* function").
* function") # v5.15.
* See also df0110425f42 ("scsi: core: Introduce the scsi_cmd_to_rq()
* function") # v5.4.263.
* See also b19fe82b4b92 ("scsi: core: Introduce the scsi_cmd_to_rq()
* function") # v5.10.203.
*/
static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
{
Expand Down Expand Up @@ -1672,11 +1682,15 @@ static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd)
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
!(LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(5, 15, 0) >> 8 && \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 136)) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
/*
* See also commit 11b68e36b167 ("scsi: core: Call scsi_done directly"; v5.16)
* See also commit 11b68e36b167 ("scsi: core: Call scsi_done directly") # v5.16.
* See also commit d2746cdfd5e5 ("scsi: core: Rename scsi_mq_done() into scsi_done() and export
* it") # v5.15.136.
*/
static inline void scsi_done(struct scsi_cmnd *cmd)
{
Expand Down Expand Up @@ -1795,8 +1809,10 @@ enum {
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3))
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 9 || \
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 3) && \
!defined(UEK_KABI_RENAME)
/*
* See also commit 64fd2ba977b1 ("scsi: scsi_transport_fc: Add an additional
* flag to fc_host_fpin_rcv()") # v6.3
Expand Down
9 changes: 9 additions & 0 deletions scst/include/scst.h
Original file line number Diff line number Diff line change
Expand Up @@ -2318,6 +2318,8 @@ struct scst_cmd {

uint32_t tgt_sn; /* SN set by target driver (for TM purposes) */

uint16_t tg_id; /* Only used during TYPE_DISK INQUIRY EVPD=0x83 */

uint8_t *cdb; /* Pointer on CDB. Points on cdb_buf for small CDBs. */
unsigned short cdb_len;
uint8_t cdb_buf[SCST_MAX_CDB_SIZE];
Expand Down Expand Up @@ -4524,6 +4526,13 @@ static inline bool scst_get_cmd_dev_d_sense(struct scst_cmd *cmd)
return (cmd->dev != NULL) ? cmd->dev->d_sense : 0;
}

/* Returns if command is INQUIRY EVPD=0x83 (device identification) */
static inline bool scst_cmd_inquired_dev_ident(struct scst_cmd *cmd)
{
return (cmd->cdb[0] == INQUIRY) && ((cmd->cdb[1] & 0x01/*EVPD*/) == 0x01) &&
(cmd->cdb[2] == 0x83/*device identification*/);
}

/*
* Get/Set functions for expected data direction, transfer length
* and its validity flag
Expand Down
4 changes: 2 additions & 2 deletions scst/include/scst_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
* and FIO_REV in usr/fileio/common.h as well.
*/
#define SCST_VERSION(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d)
#define SCST_VERSION_CODE SCST_VERSION(3, 8, 0, 0)
#define SCST_VERSION_CODE SCST_VERSION(3, 9, 0, 0)

#define SCST_VERSION_STRING_SUFFIX
#define SCST_VERSION_NAME "3.8.0-pre"
#define SCST_VERSION_NAME "3.9.0-pre"
#define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX

#ifdef SCST_REVISION
Expand Down
Loading

0 comments on commit c453967

Please sign in to comment.