You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(18) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(14) |
Feb
(14) |
Mar
(3) |
Apr
(10) |
May
(10) |
Jun
(17) |
Jul
(15) |
Aug
(24) |
Sep
(24) |
Oct
(11) |
Nov
(13) |
Dec
(15) |
2008 |
Jan
(10) |
Feb
(46) |
Mar
(20) |
Apr
(42) |
May
(44) |
Jun
(22) |
Jul
(59) |
Aug
(8) |
Sep
(15) |
Oct
(52) |
Nov
(30) |
Dec
(38) |
2009 |
Jan
(27) |
Feb
(27) |
Mar
(47) |
Apr
(85) |
May
(74) |
Jun
(41) |
Jul
(70) |
Aug
(64) |
Sep
(97) |
Oct
(147) |
Nov
(67) |
Dec
(48) |
2010 |
Jan
(68) |
Feb
(33) |
Mar
(53) |
Apr
(98) |
May
(55) |
Jun
(71) |
Jul
(99) |
Aug
(132) |
Sep
(291) |
Oct
(220) |
Nov
(344) |
Dec
(300) |
2011 |
Jan
(57) |
Feb
(25) |
Mar
(59) |
Apr
(104) |
May
(60) |
Jun
(155) |
Jul
(143) |
Aug
(43) |
Sep
(53) |
Oct
(20) |
Nov
(35) |
Dec
(103) |
2012 |
Jan
(62) |
Feb
(43) |
Mar
(29) |
Apr
(80) |
May
(75) |
Jun
(61) |
Jul
(52) |
Aug
(58) |
Sep
(33) |
Oct
(32) |
Nov
(69) |
Dec
(37) |
2013 |
Jan
(77) |
Feb
(28) |
Mar
(52) |
Apr
(18) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(55) |
Sep
(29) |
Oct
(74) |
Nov
(50) |
Dec
(44) |
2014 |
Jan
(77) |
Feb
(62) |
Mar
(81) |
Apr
(99) |
May
(59) |
Jun
(95) |
Jul
(55) |
Aug
(34) |
Sep
(78) |
Oct
(33) |
Nov
(48) |
Dec
(51) |
2015 |
Jan
(56) |
Feb
(120) |
Mar
(37) |
Apr
(15) |
May
(22) |
Jun
(196) |
Jul
(54) |
Aug
(33) |
Sep
(32) |
Oct
(42) |
Nov
(149) |
Dec
(61) |
2016 |
Jan
(15) |
Feb
(26) |
Mar
(37) |
Apr
(27) |
May
(14) |
Jun
(11) |
Jul
(13) |
Aug
(64) |
Sep
(2) |
Oct
(36) |
Nov
(18) |
Dec
(46) |
2017 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(50) |
May
(42) |
Jun
(11) |
Jul
(4) |
Aug
(12) |
Sep
(11) |
Oct
(21) |
Nov
(15) |
Dec
(42) |
2018 |
Jan
(33) |
Feb
(27) |
Mar
(20) |
Apr
(5) |
May
(4) |
Jun
(1) |
Jul
(42) |
Aug
(29) |
Sep
(11) |
Oct
(40) |
Nov
(312) |
Dec
(18) |
2019 |
Jan
(44) |
Feb
(98) |
Mar
(125) |
Apr
(160) |
May
(123) |
Jun
(33) |
Jul
(56) |
Aug
(81) |
Sep
(24) |
Oct
(23) |
Nov
(52) |
Dec
(86) |
2020 |
Jan
(6) |
Feb
(17) |
Mar
(62) |
Apr
(21) |
May
(118) |
Jun
(42) |
Jul
(52) |
Aug
(62) |
Sep
(20) |
Oct
(5) |
Nov
(23) |
Dec
(111) |
2021 |
Jan
(31) |
Feb
(8) |
Mar
(26) |
Apr
(13) |
May
(54) |
Jun
(31) |
Jul
(17) |
Aug
(10) |
Sep
(83) |
Oct
(8) |
Nov
(21) |
Dec
(33) |
2022 |
Jan
(67) |
Feb
(11) |
Mar
(4) |
Apr
(46) |
May
(12) |
Jun
(17) |
Jul
(19) |
Aug
(7) |
Sep
(53) |
Oct
(14) |
Nov
(29) |
Dec
(22) |
2023 |
Jan
(20) |
Feb
(4) |
Mar
(37) |
Apr
(25) |
May
(15) |
Jun
(20) |
Jul
(38) |
Aug
(1) |
Sep
(1) |
Oct
(34) |
Nov
|
Dec
(8) |
2024 |
Jan
(15) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(23) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Gleb C. <lna...@ya...> - 2023-10-10 11:52:29
|
Commit: 4635193 GitHub URL: https://github.com/SCST-project/scst/commit/4635193aa0f96defc58b8375d01d10c327c97302 Author: Gleb Chesnokov Date: 2023-10-10T14:51:33+03:00 Log Message: ----------- qla2x00t-32gbit: Fix deletion race condition System crash when using debug kernel due to link list corruption. The cause of the link list corruption is due to session deletion was allowed to queue up twice. Here's the internal trace that show the same port was allowed to double queue for deletion on different cpu. 20808683956 015 qla2xxx [0000:13:00.1]-e801:4: Scheduling sess ffff93ebf9306800 for deletion 50:06:0e:80:12:48:ff:50 fc4_type 1 20808683957 027 qla2xxx [0000:13:00.1]-e801:4: Scheduling sess ffff93ebf9306800 for deletion 50:06:0e:80:12:48:ff:50 fc4_type 1 Move the clearing/setting of deleted flag lock. Cc: st...@vg... Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 6dfe4344c168 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 16 +++++++++++++-- qla2x00t-32gbit/qla_target.c | 14 ++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 980c8f7..79b429f 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -508,6 +508,7 @@ static void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) { struct fc_port *fcport = ea->fcport; + unsigned long flags; ql_dbg(ql_dbg_disc, vha, 0x20d2, "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", @@ -522,9 +523,15 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) ql_dbg(ql_dbg_disc, vha, 0x2066, "%s %8phC: adisc fail: post delete\n", __func__, ea->fcport->port_name); + + spin_lock_irqsave(&vha->work_lock, flags); /* deleted = 0 & logout_on_delete = force fw cleanup */ - fcport->deleted = 0; + if (fcport->deleted == QLA_SESS_DELETED) + fcport->deleted = 0; + fcport->logout_on_delete = 1; + spin_unlock_irqrestore(&vha->work_lock, flags); + qlt_schedule_sess_for_deletion(ea->fcport); return; } @@ -1446,7 +1453,6 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); ea->fcport->login_gen++; - ea->fcport->deleted = 0; ea->fcport->logout_on_delete = 1; if (!ea->fcport->login_succ && !IS_SW_RESV_ADDR(ea->fcport->d_id)) { @@ -6093,6 +6099,8 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) void qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) { + unsigned long flags; + if (IS_SW_RESV_ADDR(fcport->d_id)) return; @@ -6102,7 +6110,11 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT); fcport->login_retry = vha->hw->login_retry_count; fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); + + spin_lock_irqsave(&vha->work_lock, flags); fcport->deleted = 0; + spin_unlock_irqrestore(&vha->work_lock, flags); + if (vha->hw->current_topology == ISP_CFG_NL) fcport->logout_on_delete = 0; else diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 9c19ba1..564819a 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -1083,10 +1083,6 @@ void qlt_free_session_done(struct work_struct *work) (struct imm_ntfy_from_isp *)sess->iocb, SRB_NACK_LOGO); } - spin_lock_irqsave(&vha->work_lock, flags); - sess->flags &= ~FCF_ASYNC_SENT; - spin_unlock_irqrestore(&vha->work_lock, flags); - spin_lock_irqsave(&ha->tgt.sess_lock, flags); if (sess->se_sess) { sess->se_sess = NULL; @@ -1096,7 +1092,6 @@ void qlt_free_session_done(struct work_struct *work) qla2x00_set_fcport_disc_state(sess, DSC_DELETED); sess->fw_login_state = DSC_LS_PORT_UNAVAIL; - sess->deleted = QLA_SESS_DELETED; if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) { vha->fcport_count--; @@ -1148,10 +1143,15 @@ void qlt_free_session_done(struct work_struct *work) sess->explicit_logout = 0; spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); - sess->free_pending = 0; qla2x00_dfs_remove_rport(vha, sess); + spin_lock_irqsave(&vha->work_lock, flags); + sess->flags &= ~FCF_ASYNC_SENT; + sess->deleted = QLA_SESS_DELETED; + sess->free_pending = 0; + spin_unlock_irqrestore(&vha->work_lock, flags); + ql_dbg(ql_dbg_disc, vha, 0xf001, "Unregistration of sess %p %8phC finished fcp_cnt %d\n", sess, sess->port_name, vha->fcport_count); @@ -1200,12 +1200,12 @@ void qlt_unreg_sess(struct fc_port *sess) * management from being sent. */ sess->flags |= FCF_ASYNC_SENT; + sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; spin_unlock_irqrestore(&sess->vha->work_lock, flags); if (sess->se_sess) vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); - sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); sess->last_rscn_gen = sess->rscn_gen; sess->last_login_gen = sess->login_gen; |
From: Gleb C. <lna...@ya...> - 2023-10-10 11:52:23
|
Commit: 55ef00a GitHub URL: https://github.com/SCST-project/scst/commit/55ef00a79a9e9570b0f99b3ecfc3b35214f56f85 Author: Gleb Chesnokov Date: 2023-10-10T14:51:33+03:00 Log Message: ----------- qla2x00t: Avoid flush_scheduled_work() usage See also commit c014d35e7d88 ("qla2x00t-32gbit: Avoid flush_scheduled_work() usage"). Modified Paths: -------------- qla2x00t/qla2x00-target/qla2x00t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index c6aa31e..06ade1a 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -1680,7 +1680,7 @@ static void q2t_target_stop(struct scst_tgt *scst_tgt) spin_lock_irq(&tgt->sess_work_lock); while (!list_empty(&tgt->sess_works_list)) { spin_unlock_irq(&tgt->sess_work_lock); - flush_scheduled_work(); + flush_work(&tgt->sess_work); spin_lock_irq(&tgt->sess_work_lock); } spin_unlock_irq(&tgt->sess_work_lock); |
From: Gleb C. <lna...@ya...> - 2023-10-10 11:52:03
|
Commit: 48e0466 GitHub URL: https://github.com/SCST-project/scst/commit/48e04668d62e76232645ae93ea02150349a18636 Author: Gleb Chesnokov Date: 2023-10-10T14:51:33+03:00 Log Message: ----------- qla2x00t: Drop redundant pci_enable_pcie_error_reporting() See also commits: - 7d1afe8a ("qla2x00t-32gbit: Drop redundant pci_enable_pcie_error_reporting()"). - 596800ce ("qla2x00t-32gbit: Backport to older kernel versions"). Modified Paths: -------------- qla2x00t/qla_def.h | 4 ++++ qla2x00t/qla_os.c | 4 ++++ 2 files changed, 8 insertions(+) =================================================================== diff --git a/qla2x00t/qla_def.h b/qla2x00t/qla_def.h index 19bdec1..3e78f97 100644 --- a/qla2x00t/qla_def.h +++ b/qla2x00t/qla_def.h @@ -7,7 +7,9 @@ #ifndef __QLA_DEF_H #define __QLA_DEF_H +#ifndef INSIDE_KERNEL_TREE #include <linux/version.h> +#endif #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> @@ -24,7 +26,9 @@ #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/firmware.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #include <linux/aer.h> +#endif #include <linux/mutex.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || \ diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 5d34b93..f9c3ea8 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -2367,8 +2367,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto probe_out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) /* This may fail but that's ok */ pci_enable_pcie_error_reporting(pdev); +#endif ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { @@ -3020,7 +3022,9 @@ qla2x00_remove_one(struct pci_dev *pdev) kfree(ha); ha = NULL; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) pci_disable_pcie_error_reporting(pdev); +#endif pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } |
From: Gleb C. <lna...@ya...> - 2023-10-09 06:46:55
|
Commit: 60c2613 GitHub URL: https://github.com/SCST-project/scst/commit/60c26136bf9331ebd80828fc9f97b2a0b8acbdb2 Author: Gleb Chesnokov Date: 2023-10-09T09:46:21+03:00 Log Message: ----------- scst/include/backport.h: Unbreak the RHEL 9.3 build Fixes: https://github.com/SCST-project/scst/issues/167 Modified Paths: -------------- scst/include/backport.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index a57cf53..9691bdd 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1760,7 +1760,9 @@ enum { #define wwn_to_u64(wwn) get_unaligned_be64(wwn) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3)) /* * See also commit 64fd2ba977b1 ("scsi: scsi_transport_fc: Add an additional * flag to fc_host_fpin_rcv()") # v6.3 |
From: Gleb C. <lna...@ya...> - 2023-09-21 07:28:27
|
Commit: c71c284 GitHub URL: https://github.com/SCST-project/scst/commit/c71c284f934766ef5feddfe175bd91fea7c2b11e Author: Gleb Chesnokov Date: 2023-09-21T10:27:58+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update following the 6.5 release. Modified Paths: -------------- nightly/conf/nightly.conf | 31 ++++++++------- 1 file changed, 16 insertions(+), 15 deletions(-) =================================================================== diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 5246074..1f596da 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,38 +3,39 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -6.4 \ -6.3.9-nc \ +6.5.4 \ +6.4.16-nc \ +6.3.13-nc \ 6.2.16-nc \ -6.1.35-nc \ +6.1.54-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.118-nc \ +5.15.132-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.185-nc \ +5.10.195-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.248-nc \ +5.4.256-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.287-nc \ +4.19.294-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.319-nc \ +4.14.325-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ @@ -59,10 +60,10 @@ ABT_KERNELS=" \ 3.12.74-nc \ 3.11.10-nc \ 3.10.108-nc \ -5.14.0-284.11.1.el9_2^AlmaLinux^9.2-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.13.1.el8_8^AlmaLinux^8.8-nc \ +4.18.0-477.21.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 \ @@ -71,18 +72,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.90.1.el7^CentOS^7.9.2009-nc \ +3.10.0-1160.95.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-102.110.5.1.el9uek^UEK^9-nc \ -5.15.0-102.110.5.1.el8uek^UEK^8-nc \ -5.4.17-2136.320.7.1.el8uek^UEK^8-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.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.320.7.1.el7uek^UEK^7-nc \ +5.4.17-2136.323.8.1.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 \ |
From: Gleb C. <lna...@ya...> - 2023-08-22 07:03:15
|
Commit: 3c8f66e GitHub URL: https://github.com/SCST-project/scst/commit/3c8f66e2b8876d4bbd9e14b56f48ab011de8d1bd Author: Brian Meagher Date: 2023-08-22T10:02:40+03:00 Log Message: ----------- Add support for iSCSI TargetAlias This includes both support during iSCSI LOGIN and iSNS. Modified Paths: -------------- iscsi-scst/README | 5 ++ iscsi-scst/usr/config.c | 26 +++++++ iscsi-scst/usr/ctldev.c | 12 +++- iscsi-scst/usr/event.c | 53 +++++++++++++++ iscsi-scst/usr/iscsid.c | 2 + iscsi-scst/usr/iscsid.h | 2 + iscsi-scst/usr/isns.c | 16 ++++- iscsi-scst/usr/param.h | 1 + 8 files changed, 115 insertions(+), 2 deletions(-) =================================================================== diff --git a/iscsi-scst/README b/iscsi-scst/README index 9f67fac..d086c6e 100644 --- a/iscsi-scst/README +++ b/iscsi-scst/README @@ -283,6 +283,10 @@ Each target subdirectory contains the following entries: - tid - TID of this target. + - alias - TargetAlias of this target. If not set, it will default to the + empty string and no TargetAlias will be reported in LOGIN RESPONSE or iSNS + for this target. + The "sessions" subdirectory contains the following attribute: - thread_pid - the process identifiers (PIDs) of the iscsird and iscsiwr @@ -559,6 +563,7 @@ both iSCSI-SCST targets will look like: | | |-- NopInInterval | | |-- QueuedCommands | | |-- RspTimeout +| | |-- alias | | |-- enabled | | |-- ini_groups | | | `-- mgmt diff --git a/iscsi-scst/usr/config.c b/iscsi-scst/usr/config.c index e90a05b..35fb16b 100644 --- a/iscsi-scst/usr/config.c +++ b/iscsi-scst/usr/config.c @@ -265,6 +265,32 @@ char *config_sep_string(char **pp) return p; } +/* + * Strip leading and trailing whitespace. + * + * Modifies the contents of the parameter string. + */ +char *config_strip_string(char *s) +{ + size_t size; + char *end; + + size = strlen(s); + + if (!size) + return s; + + end = s + size - 1; + while (end >= s && isspace(*end)) + end--; + *(end + 1) = '\0'; + + while (*s && isspace(*s)) + s++; + + return s; +} + static char *config_gets(char *buf, int size, const char *data, int *offset) { int offs = *offset, i = 0; diff --git a/iscsi-scst/usr/ctldev.c b/iscsi-scst/usr/ctldev.c index 70258cc..49efe56 100644 --- a/iscsi-scst/usr/ctldev.c +++ b/iscsi-scst/usr/ctldev.c @@ -78,7 +78,12 @@ int kernel_target_create(struct target *target, u32 *tid, u32 cookie) info.tid = (tid != NULL) ? *tid : 0; info.cookie = cookie; - info.attrs_num = 2; + /* + * ISCSI_PER_PORTAL_ACL_ATTR_NAME + * ISCSI_TARGET_REDIRECTION_ATTR_NAME + * ISCSI_TARGET_ALIAS_ATTR_NAME + */ + info.attrs_num = 3; for (j = 0; j < session_key_last; j++) { if (session_keys[j].show_in_sysfs) @@ -117,6 +122,11 @@ int kernel_target_create(struct target *target, u32 *tid, u32 cookie) sizeof(ISCSI_TARGET_REDIRECTION_ATTR_NAME)); i++; + kern_attrs[i].mode = 0644; + strlcpy(kern_attrs[i].name, ISCSI_TARGET_ALIAS_ATTR_NAME, + sizeof(ISCSI_TARGET_ALIAS_ATTR_NAME)); + i++; + for (j = 0; j < session_key_last; j++) { if (!session_keys[j].show_in_sysfs) continue; diff --git a/iscsi-scst/usr/event.c b/iscsi-scst/usr/event.c index 61cb132..e08cd4b 100644 --- a/iscsi-scst/usr/event.c +++ b/iscsi-scst/usr/event.c @@ -611,6 +611,17 @@ static int handle_e_get_attr_value(int fd, const struct iscsi_kern_event *event) add_key_mark(res_str, sizeof(res_str), 0); } else *res_str = '\0'; + } else if (strcasecmp(ISCSI_TARGET_ALIAS_ATTR_NAME, pp) == 0) { + if (target == NULL) { + log_error("Target expected for attr %s", pp); + res = -EINVAL; + goto out_free; + } + if (target->alias) { + snprintf(res_str, sizeof(res_str), "%s\n", target->alias); + add_key_mark(res_str, sizeof(res_str), 0); + } else + *res_str = '\0'; } else if (strcasecmp(ISCSI_ISNS_SERVER_ATTR_NAME, pp) == 0) { if (target != NULL) { log_error("Not NULL target %s for global attribute %s", @@ -955,6 +966,48 @@ static int handle_e_set_attr_value(int fd, const struct iscsi_kern_event *event) res = handle_target_redirect(target, p); if (res != 0) goto out_free; + } else if (strcasecmp(ISCSI_TARGET_ALIAS_ATTR_NAME, pp) == 0) { + bool alias_changed = false; + + if (target == NULL) { + log_error("Target expected for attr %s", pp); + res = -EINVAL; + goto out_free; + } + p = config_strip_string(p); + if (*p == '\0') { + if (target->alias) { + free(target->alias); + target->alias = NULL; + alias_changed = true; + } + } else { + char *newval = strdup(p); + + if (newval == NULL) { + log_error("Unable to duplicate alias name %s", p); + res = -ENOMEM; + goto out_free; + } + if (target->alias) + free(target->alias); + target->alias = newval; + alias_changed = true; + } + /* If we previously registered an alias and we need to update it */ + if (alias_changed && target->isns_registered) { + if (target->alias) { + isns_target_register(target->name); + } else { + /* + * We have cleared a previously set alias. + * Work-around to make change visible in + * open-isns server. + */ + isns_target_deregister(target->name); + isns_target_register(target->name); + } + } } else if (strcasecmp(ISCSI_ISNS_SERVER_ATTR_NAME, pp) == 0) { if (target != NULL) { log_error("Not NULL target %s for global attribute %s", diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index 773fa50..1ef94ce 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -921,6 +921,8 @@ static void login_start(struct connection *conn) return; } } + if (target->alias) + text_key_add(conn, "TargetAlias", target->alias); log_debug(1, "target %s, sessions_count %d", target_name, target->sessions_count); } diff --git a/iscsi-scst/usr/iscsid.h b/iscsi-scst/usr/iscsid.h index 4155d2a..69146bd 100644 --- a/iscsi-scst/usr/iscsid.h +++ b/iscsi-scst/usr/iscsid.h @@ -198,6 +198,7 @@ struct target { unsigned int tgt_enabled:1; unsigned int per_portal_acl:1; + unsigned int isns_registered:1; unsigned int target_params[target_key_last]; unsigned int session_params[session_key_last]; @@ -353,6 +354,7 @@ extern int nl_open(void); /* config.c */ extern char *config_sep_string(char **pp); +extern char *config_strip_string(char *s); extern int config_parse_main(const char *data, u32 cookie); extern int config_load(const char *config_name); extern int config_target_create(u32 *tid, char *name); diff --git a/iscsi-scst/usr/isns.c b/iscsi-scst/usr/isns.c index 75ffa8a..323e00c 100644 --- a/iscsi-scst/usr/isns.c +++ b/iscsi-scst/usr/isns.c @@ -482,7 +482,7 @@ int isns_target_register(char *name) uint32_t port = htonl(server_port); uint32_t node = htonl(ISNS_NODE_TARGET); uint32_t type = htonl(2); - struct target *target; + struct target *target, *alias_target; int err, initial = list_length_is_one(&targets_list); int max_buf; @@ -499,6 +499,7 @@ int isns_target_register(char *name) tlv = (struct isns_tlv *)hdr->pdu; max_buf = sizeof(buf) - offsetof(struct isns_hdr, pdu); + alias_target = target_find_by_name(name); if (strlen(isns_entity_target_name) < 1) { target = list_entry(targets_list.q_forw, struct target, tlist); err = isns_tlv_set(&tlv, max_buf - length, ISNS_ATTR_ISCSI_NAME, @@ -566,6 +567,14 @@ int isns_target_register(char *name) goto out; length += err; + if (alias_target && alias_target->alias) { + err = isns_tlv_set(&tlv, max_buf - length, ISNS_ATTR_ISCSI_ALIAS, + strlen(alias_target->alias) + 1, alias_target->alias); + if (err < 0) + goto out; + length += err; + } + err = isns_tlv_set(&tlv, max_buf - length, ISNS_ATTR_ISCSI_NODE_TYPE, sizeof(node), &node); if (err < 0) @@ -579,6 +588,8 @@ int isns_target_register(char *name) err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); + else if (alias_target) + alias_target->isns_registered = 1; if (scn_listen_port) isns_scn_register(); @@ -662,6 +673,9 @@ int isns_target_deregister(char *name) if (err < 0) log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); + if (target) + target->isns_registered = 0; + out: return err; } diff --git a/iscsi-scst/usr/param.h b/iscsi-scst/usr/param.h index 994232c..6a1d8b7 100644 --- a/iscsi-scst/usr/param.h +++ b/iscsi-scst/usr/param.h @@ -25,6 +25,7 @@ #define ISCSI_TARGET_REDIRECTION_ATTR_NAME "redirect" #define ISCSI_TARGET_REDIRECTION_VALUE_TEMP "temp" #define ISCSI_TARGET_REDIRECTION_VALUE_PERM "perm" +#define ISCSI_TARGET_ALIAS_ATTR_NAME "alias" struct iscsi_key; |
From: Gleb C. <lna...@ya...> - 2023-07-21 08:03:40
|
Commit: 7c8e5c9 GitHub URL: https://github.com/SCST-project/scst/commit/7c8e5c94aba47f7f9c6ecd5f963a8e5386ed2e48 Author: Gleb Chesnokov Date: 2023-07-21T11:02:51+03:00 Log Message: ----------- scst: Fix removal of deprecated create_workqueue() create_workqueue() was replaced with alloc_workqueue() with max_active set to 0. However, the original create_workqueue() implicitly set max_active to 1. This change has led to unexpected bugs because previously, work items could only be executed one by one. With the change, they can now be executed simultaneously. This patch fixes the issue by restoring max_active to 1. Fixes: f4686e9102c1 ("scst: Remove deprecated create_workqueue()") Fixes: https://github.com/SCST-project/scst/issues/179 Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser_global.c | 2 +- qla2x00t/qla_os.c | 2 +- scst/src/scst_lib.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index 5b8b92b..e6e0ec2 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -138,7 +138,7 @@ int isert_global_init(void) spin_lock_init(&isert_glob.portal_lock); init_waitqueue_head(&isert_glob.portal_wq); - isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 0); + isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 1); if (!isert_glob.conn_wq) { PRINT_ERROR("Failed to alloc iser conn work queue"); return -ENOMEM; diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 1b49c4d..92d5b24 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -450,7 +450,7 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) "Failed to create request queue.\n"); goto fail; } - ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); + ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 1); vha->req = ha->req_q_map[req]; options |= BIT_1; for (ques = 1; ques < ha->max_rsp_queues; ques++) { diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 7adc568..1559230 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15412,7 +15412,7 @@ int __init scst_lib_init(void) scst_scsi_op_list_init(); - scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 0); + scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 1); if (unlikely(!scst_release_acg_wq)) { PRINT_ERROR("Failed to allocate scst_release_acg_wq"); res = -ENOMEM; |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:45
|
Commit: c00af8a GitHub URL: https://github.com/SCST-project/scst/commit/c00af8aab9d82d4b61dc466a38e373dd4132c244 Author: Gleb Chesnokov Date: 2023-07-21T10:38:52+03:00 Log Message: ----------- scst_lib: Improve scst_put_acg() This patch refactors scst_put_acg() to directly call kref_put() with a release callback that handles removal of scst_acg from the workqueue. This replaces the previous approach of queuing a work item for each kref_put() call, improving efficiency by reducing the number of queued work items. Modified Paths: -------------- scst/src/scst_lib.c | 45 +++++++-------- 1 file changed, 21 insertions(+), 24 deletions(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 208e58d..02d03ba 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -70,7 +70,6 @@ static DEFINE_SPINLOCK(scst_global_stpg_list_lock); static LIST_HEAD(scst_global_stpg_list); -static void scst_put_acg_work(struct work_struct *work); static void scst_free_acn(struct scst_acn *acn, bool reassign); struct scsi_io_context { @@ -4826,49 +4825,47 @@ static void scst_free_acg(struct scst_acg *acg) kobject_put(&tgt->tgt_kobj); } -static void scst_release_acg(struct kref *kref) -{ - struct scst_acg *acg = container_of(kref, struct scst_acg, acg_kref); - - scst_free_acg(acg); -} - -struct scst_acg_put_work { +struct scst_acg_release_work { struct work_struct work; struct scst_acg *acg; }; -static void scst_put_acg_work(struct work_struct *work) +static void scst_release_acg_work(struct work_struct *work) { - struct scst_acg_put_work *put_work = - container_of(work, typeof(*put_work), work); - struct scst_acg *acg = put_work->acg; + struct scst_acg_release_work *release_work = + container_of(work, typeof(*release_work), work); + struct scst_acg *acg = release_work->acg; - kfree(put_work); - kref_put(&acg->acg_kref, scst_release_acg); + kfree(release_work); + scst_free_acg(acg); } -void scst_put_acg(struct scst_acg *acg) +static void scst_release_acg(struct kref *kref) { - struct scst_acg_put_work *put_work; + struct scst_acg *acg = container_of(kref, struct scst_acg, acg_kref); + struct scst_acg_release_work *release_work; bool rc; - put_work = kmalloc(sizeof(*put_work), GFP_KERNEL | __GFP_NOFAIL); - if (WARN_ON_ONCE(!put_work)) { - kref_put(&acg->acg_kref, scst_release_acg); + release_work = kmalloc(sizeof(*release_work), GFP_KERNEL | __GFP_NOFAIL); + if (WARN_ON_ONCE(!release_work)) { + scst_free_acg(acg); return; } - INIT_WORK(&put_work->work, scst_put_acg_work); - put_work->acg = acg; + INIT_WORK(&release_work->work, scst_release_acg_work); + release_work->acg = acg; /* * Schedule the kref_put() call instead of invoking it directly to * avoid deep recursion and a stack overflow. */ - rc = queue_work(scst_release_acg_wq, &put_work->work); + rc = queue_work(scst_release_acg_wq, &release_work->work); WARN_ON_ONCE(!rc); - return; +} + +void scst_put_acg(struct scst_acg *acg) +{ + kref_put(&acg->acg_kref, scst_release_acg); } void scst_get_acg(struct scst_acg *acg) |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:32
|
Commit: 4b840ae GitHub URL: https://github.com/SCST-project/scst/commit/4b840aeee395d554ac699ad2736553d5181ddda5 Author: Gleb Chesnokov Date: 2023-07-21T10:38:52+03:00 Log Message: ----------- scst: Do not use WQ_MEM_RECLAIM flag for workqueues According to kernel documentation, this flag should be set if the workqueue will be involved in the kernel's memory reclamation flow. Since it is not, there is no need for the driver's WQ to have this flag set so remove it. Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser_global.c | 2 +- iscsi-scst/kernel/isert-scst/iser_rdma.c | 2 +- scst/src/scst_event.c | 2 +- scst/src/scst_lib.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index e6e0ec2..c070a66 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -138,7 +138,7 @@ int isert_global_init(void) spin_lock_init(&isert_glob.portal_lock); init_waitqueue_head(&isert_glob.portal_wq); - isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 1); + isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", 0, 1); if (!isert_glob.conn_wq) { PRINT_ERROR("Failed to alloc iser conn work queue"); return -ENOMEM; diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 439e369..c5e30b1 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1792,7 +1792,7 @@ struct isert_portal *isert_portal_create(struct sockaddr *sa, size_t addr_len) goto err_alloc; } - portal->reinit_id_wq = alloc_ordered_workqueue("isert_reinit_id_wq", WQ_MEM_RECLAIM); + portal->reinit_id_wq = alloc_ordered_workqueue("isert_reinit_id_wq", 0); if (unlikely(!portal->reinit_id_wq)) { PRINT_ERROR("Unable to allocate reinit workqueue"); err = -ENOMEM; diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 7221008..b744e17 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -1111,7 +1111,7 @@ int scst_event_init(void) TRACE_ENTRY(); - scst_event_wq = alloc_workqueue("scst_event_wq", WQ_MEM_RECLAIM, 0); + scst_event_wq = alloc_workqueue("scst_event_wq", 0, 0); if (unlikely(!scst_event_wq)) { PRINT_ERROR("Failed to allocate scst_event_wq"); res = -ENOMEM; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e126230..208e58d 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15499,7 +15499,7 @@ int __init scst_lib_init(void) scst_scsi_op_list_init(); - scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 1); + scst_release_acg_wq = alloc_workqueue("scst_release_acg", 0, 1); if (unlikely(!scst_release_acg_wq)) { PRINT_ERROR("Failed to allocate scst_release_acg_wq"); res = -ENOMEM; |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:29
|
Commit: 87235df GitHub URL: https://github.com/SCST-project/scst/commit/87235dfe3a2093b12ec8239553a80eacd3a59b22 Author: Gleb Chesnokov Date: 2023-07-21T10:38:34+03:00 Log Message: ----------- scst: Use vmalloc_array() and vcalloc() Use vmalloc_array() and vcalloc() to protect against multiplication overflows. The changes were done using the following Coccinelle semantic patch: // <smpl> @initialize:ocaml@ @@ let rename alloc = match alloc with "vmalloc" -> "vmalloc_array" | "vzalloc" -> "vcalloc" | _ -> failwith "unknown" @@ size_t e1,e2; constant C1, C2; expression E1, E2, COUNT, x1, x2, x3; typedef u8; typedef __u8; type t = {u8,__u8,char,unsigned char}; identifier alloc = {vmalloc,vzalloc}; fresh identifier realloc = script:ocaml(alloc) { rename alloc }; @@ ( alloc(x1*x2*x3) | alloc(C1 * C2) | alloc((sizeof(t)) * (COUNT), ...) | - alloc((e1) * (e2)) + realloc(e1, e2) | - alloc((e1) * (COUNT)) + realloc(COUNT, e1) | - alloc((E1) * (E2)) + realloc(E1, E2) ) // </smpl> Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser_rdma.c | 3 +- qla2x00t-32gbit/qla_init.c | 4 +-- scst/include/backport.h | 22 +++++++++++++++ scst/src/scst_dlm.c | 7 ++--- 4 files changed, 28 insertions(+), 8 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index bad41bf..439e369 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -938,8 +938,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev) goto free_isert_dev; } - isert_dev->cq_desc = vmalloc(sizeof(*isert_dev->cq_desc) * - isert_dev->num_cqs); + isert_dev->cq_desc = vmalloc_array(isert_dev->num_cqs, sizeof(*isert_dev->cq_desc)); if (unlikely(isert_dev->cq_desc == NULL)) { PRINT_ERROR("Failed to allocate %zd bytes for iser cq_desc", sizeof(*isert_dev->cq_desc) * isert_dev->num_cqs); diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 88da7b5..980c8f7 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -8437,7 +8437,7 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr, ql_dbg(ql_dbg_init, vha, 0x0163, "-> fwdt%u template allocate template %#x words...\n", j, risc_size); - fwdt->template = vmalloc(risc_size * sizeof(*dcode)); + fwdt->template = vmalloc_array(risc_size, sizeof(*dcode)); if (!fwdt->template) { ql_log(ql_log_warn, vha, 0x0164, "-> fwdt%u failed allocate template.\n", j); @@ -8692,7 +8692,7 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr) ql_dbg(ql_dbg_init, vha, 0x0173, "-> fwdt%u template allocate template %#x words...\n", j, risc_size); - fwdt->template = vmalloc(risc_size * sizeof(*dcode)); + fwdt->template = vmalloc_array(risc_size, sizeof(*dcode)); if (!fwdt->template) { ql_log(ql_log_warn, vha, 0x0174, "-> fwdt%u failed allocate template.\n", j); diff --git a/scst/include/backport.h b/scst/include/backport.h index f4fc281..a57cf53 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -849,6 +849,28 @@ static inline void kvfree(void *addr) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) && \ + (LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 15, 0) >> 8 || \ + LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 54)) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 0)) && \ + (!defined(UEK_KABI_RENAME) || \ + LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)) +/* + * See also commit a8749a35c3990 ("mm: vmalloc: introduce array allocation functions") # v5.18, + * v5.15.54. + */ +static inline void *vmalloc_array(size_t n, size_t size) +{ + return vmalloc(n * size); +} + +static inline void *vcalloc(size_t n, size_t size) +{ + return vzalloc(n * size); +} +#endif + /* <linux/shrinker.h> */ #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) && \ diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 8afedb1..7e634af 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -304,11 +304,10 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, nr_registrants = be32_to_cpu(lvb->nr_registrants); if (nr_registrants) { - reg_lksb = vzalloc((sizeof(*reg_lksb) + PR_DLM_LVB_LEN) * - nr_registrants); + reg_lksb = vcalloc(nr_registrants, sizeof(*reg_lksb) + PR_DLM_LVB_LEN); if (!reg_lksb) { - PRINT_ERROR("%s: failed to allocate %d * %zd bytes of" - " memory", __func__, nr_registrants, + PRINT_ERROR("%s: failed to allocate %u * %zu bytes of memory", + __func__, nr_registrants, sizeof(*reg_lksb) + PR_DLM_LVB_LEN); goto out; } |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:16
|
Commit: 1f0ce86 GitHub URL: https://github.com/SCST-project/scst/commit/1f0ce86f3c3f37a6f08f1a0e2a62e589ae5d3e7e Author: Gleb Chesnokov Date: 2023-07-21T10:38:52+03:00 Log Message: ----------- scst: Fix removal of deprecated create_workqueue() create_workqueue() was replaced with alloc_workqueue() with max_active set to 0. However, the original create_workqueue() implicitly set max_active to 1. This change has led to unexpected bugs because previously, work items could only be executed one by one. With the change, they can now be executed simultaneously. This patch fixes the issue by restoring max_active to 1. Fixes: f4686e9102c1 ("scst: Remove deprecated create_workqueue()") Fixes: https://github.com/SCST-project/scst/issues/179 Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser_global.c | 2 +- qla2x00t/qla_os.c | 2 +- scst/src/scst_lib.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index 5b8b92b..e6e0ec2 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -138,7 +138,7 @@ int isert_global_init(void) spin_lock_init(&isert_glob.portal_lock); init_waitqueue_head(&isert_glob.portal_wq); - isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 0); + isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 1); if (!isert_glob.conn_wq) { PRINT_ERROR("Failed to alloc iser conn work queue"); return -ENOMEM; diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 0c3c70a..5d34b93 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -450,7 +450,7 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) "Failed to create request queue.\n"); goto fail; } - ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); + ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 1); vha->req = ha->req_q_map[req]; options |= BIT_1; for (ques = 1; ques < ha->max_rsp_queues; ques++) { diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 283a28b..e126230 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15499,7 +15499,7 @@ int __init scst_lib_init(void) scst_scsi_op_list_init(); - scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 0); + scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 1); if (unlikely(!scst_release_acg_wq)) { PRINT_ERROR("Failed to allocate scst_release_acg_wq"); res = -ENOMEM; |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:16
|
Commit: ceff753 GitHub URL: https://github.com/SCST-project/scst/commit/ceff753e131d75c9c7a12eadc625d90807943c89 Author: Gleb Chesnokov Date: 2023-07-21T10:38:34+03:00 Log Message: ----------- qla2x00t-32gbit: Fix error code in qla2x00_start_sp() This should be negative -EAGAIN instead of positive. The callers treat non-zero error codes the same so it doesn't really impact runtime beyond some trivial differences to debug output. Fixes: 80676d054e5a ("scsi: qla2xxx: Fix session cleanup hang") Signed-off-by: Dan Carpenter <dan...@li...> Link: https://lore.kernel.org/r/498...@mo...untain Signed-off-by: Martin K. Petersen <mar...@or...> [ commit e579b007eff3f upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_iocb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index 7cd7ef2..6670b37 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -3928,7 +3928,7 @@ qla2x00_start_sp(srb_t *sp) pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); if (!pkt) { - rval = EAGAIN; + rval = -EAGAIN; ql_log(ql_log_warn, vha, 0x700c, "qla2x00_alloc_iocbs failed.\n"); goto done; |
From: Gleb C. <lna...@ya...> - 2023-07-21 07:39:01
|
Commit: 1d37f63 GitHub URL: https://github.com/SCST-project/scst/commit/1d37f637e649a465eeaedbda07894b3ee11df364 Author: Gleb Chesnokov Date: 2023-07-21T10:38:34+03:00 Log Message: ----------- qla2x00t-32gbit: Silence a static checker warning Smatch and Clang both complain that LOGIN_TEMPLATE_SIZE is more than sizeof(ha->plogi_els_payld.fl_csp). Smatch warning: drivers/scsi/qla2xxx/qla_iocb.c:3075 qla24xx_els_dcmd2_iocb() warn: '&ha->plogi_els_payld.fl_csp' sometimes too small '16' size = 112 Clang warning: include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] __read_overflow2_field(q_size_field, size); When I was reading this code I assumed the "- 4" meant that we were skipping the last 4 bytes but actually it turned out that we are skipping the first four bytes. I have re-written it remove the magic numbers, be more clear and silence the static checker warnings. Signed-off-by: Dan Carpenter <dan...@li...> Link: https://lore.kernel.org/r/4aa...@mo...untain Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 134f66959cd0b upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 - qla2x00t-32gbit/qla_iocb.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 674d4bd..5a3a519 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -4514,7 +4514,6 @@ struct qla_hw_data { /* n2n */ struct fc_els_flogi plogi_els_payld; -#define LOGIN_TEMPLATE_SIZE (sizeof(struct fc_els_flogi) - 4) void *swl; diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index bdf505a..7cd7ef2 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -3089,7 +3089,8 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, memset(ptr, 0, sizeof(struct els_plogi_payload)); memset(resp_ptr, 0, sizeof(struct els_plogi_payload)); memcpy(elsio->u.els_plogi.els_plogi_pyld->data, - &ha->plogi_els_payld.fl_csp, LOGIN_TEMPLATE_SIZE); + (void *)&ha->plogi_els_payld + offsetof(struct fc_els_flogi, fl_csp), + sizeof(ha->plogi_els_payld) - offsetof(struct fc_els_flogi, fl_csp)); elsio->u.els_plogi.els_cmd = els_opcode; elsio->u.els_plogi.els_plogi_pyld->opcode = els_opcode; |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:47:26
|
Commit: 7076a91 GitHub URL: https://github.com/SCST-project/scst/commit/7076a91a3b658dc849dfcf8e1bd95b5290b723a4 Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Remove unused nvme_ls_waitq wait queue System crash when qla2x00_start_sp(sp) returns error code EGAIN and wake_up gets called for uninitialized wait queue sp->nvme_ls_waitq. qla2xxx [0000:37:00.1]-2121:5: Returning existing qpair of ffff8ae2c0513400 for idx=0 qla2xxx [0000:37:00.1]-700e:5: qla2x00_start_sp failed = 11 BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 Workqueue: nvme-wq nvme_fc_connect_ctrl_work [nvme_fc] RIP: 0010:__wake_up_common+0x4c/0x190 RSP: 0018:ffff95f3e0cb7cd0 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff8b08d3b26328 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000003 RDI: ffff8b08d3b26320 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffe8 R10: 0000000000000000 R11: ffff95f3e0cb7a60 R12: ffff95f3e0cb7d20 R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8b2fdf6c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000002f1e410002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __wake_up_common_lock+0x7c/0xc0 qla_nvme_ls_req+0x355/0x4c0 [qla2xxx] ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] Remove unused nvme_ls_waitq wait queue. nvme_ls_waitq logic was removed previously in the commits tagged Fixed: below. Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") Fixes: 5621b0dd7453 ("scsi: qla2xxx: Simpify unregistration of FC-NVMe local/remote ports") Cc: st...@vg... Signed-off-by: Manish Rangankar <mra...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 20fce500b232 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 - qla2x00t-32gbit/qla_nvme.c | 3 --- 2 files changed, 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 4a496a6..674d4bd 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -750,7 +750,6 @@ typedef struct srb { struct iocb_resource iores; struct kref cmd_kref; /* need to migrate ref_count over to this */ void *priv; - wait_queue_head_t nvme_ls_waitq; struct fc_port *fcport; struct scsi_qla_host *vha; unsigned int start_timer:1; diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index de69486..c3ae67f 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -375,7 +375,6 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport, if (rval != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x700e, "qla2x00_start_sp failed = %d\n", rval); - wake_up(&sp->nvme_ls_waitq); sp->priv = NULL; priv->sp = NULL; qla2x00_rel_sp(sp); @@ -667,7 +666,6 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, if (!sp) return -EBUSY; - init_waitqueue_head(&sp->nvme_ls_waitq); kref_init(&sp->cmd_kref); spin_lock_init(&priv->cmd_lock); sp->priv = priv; @@ -686,7 +684,6 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, if (rval != QLA_SUCCESS) { ql_log(ql_log_warn, vha, 0x212d, "qla2x00_start_nvme_mq failed = %d\n", rval); - wake_up(&sp->nvme_ls_waitq); sp->priv = NULL; priv->sp = NULL; qla2xxx_rel_qpair_sp(sp->qpair, sp); |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:47:10
|
Commit: 29d26d6 GitHub URL: https://github.com/SCST-project/scst/commit/29d26d69db0de122e0f6d2917cd3acfd14b03f7f Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Update version to 10.02.08.400-k Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 991e7ac609ee upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_version.h b/qla2x00t-32gbit/qla_version.h index 4d6f06f..e377192 100644 --- a/qla2x00t-32gbit/qla_version.h +++ b/qla2x00t-32gbit/qla_version.h @@ -6,9 +6,9 @@ /* * Driver version */ -#define QLA2XXX_VERSION "10.02.08.300-k" +#define QLA2XXX_VERSION "10.02.08.400-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_PATCH_VER 8 -#define QLA_DRIVER_BETA_VER 300 +#define QLA_DRIVER_BETA_VER 400 |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:46:55
|
Commit: bb9b171 GitHub URL: https://github.com/SCST-project/scst/commit/bb9b171dc414eafa2c2cb34eb30799b7ecdafcc9 Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Correct the index of array Klocwork reported array 'port_dstate_str' of size 10 may use index value(s) 10..15. Add a fix to correct the index of array. Cc: st...@vg... Signed-off-by: Bikash Hazarika <bha...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit b1b9d3825df4 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_inline.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index b1bf22d..d635b42 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -117,11 +117,13 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state) { int old_val; uint8_t shiftbits, mask; + uint8_t port_dstate_str_sz; /* This will have to change when the max no. of states > 16 */ shiftbits = 4; mask = (1 << shiftbits) - 1; + port_dstate_str_sz = sizeof(port_dstate_str) / sizeof(char *); fcport->disc_state = state; while (1) { old_val = atomic_read(&fcport->shadow_disc_state); @@ -129,7 +131,8 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state) old_val, (old_val << shiftbits) | state)) { ql_dbg(ql_dbg_disc, fcport->vha, 0x2134, "FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n", - fcport->port_name, port_dstate_str[old_val & mask], + fcport->port_name, (old_val & mask) < port_dstate_str_sz ? + port_dstate_str[old_val & mask] : "Unknown", port_dstate_str[state], fcport->d_id.b24); return; } |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:46:40
|
Commit: 1f107c7 GitHub URL: https://github.com/SCST-project/scst/commit/1f107c7ee56f9f4792e5ed56e16872282c23199b Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Pointer may be dereferenced Klocwork tool reported pointer 'rport' returned from call to function fc_bsg_to_rport() may be NULL and will be dereferenced. Add a fix to validate rport before dereferencing. Cc: st...@vg... Signed-off-by: Shreyas Deodhar <sde...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 00eca15319d9 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_bsg.c | 2 ++ 1 file changed, 2 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index 25de9fb..cc8c98d 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -3000,6 +3000,8 @@ qla24xx_bsg_request(BSG_JOB_TYPE *bsg_job) if (bsg_request->msgcode == FC_BSG_RPT_ELS) { rport = fc_bsg_to_rport(bsg_job); + if (!rport) + return ret; host = rport_to_shost(rport); vha = shost_priv(host); } else { |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:46:24
|
Commit: beabef8 GitHub URL: https://github.com/SCST-project/scst/commit/beabef8afc73404ec92255e7a955cd1d64ba539e Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Fix buffer overrun Klocwork warning: Buffer Overflow - Array Index Out of Bounds Driver uses fc_els_flogi to calculate size of buffer. The actual buffer is nested inside of fc_els_flogi which is smaller. Replace structure name to allow proper size calculation. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit b68710a8094f upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 3a5edf3..88da7b5 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -5552,7 +5552,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha) __be32 *q; memset(ha->init_cb, 0, ha->init_cb_size); - sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size); + sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size); rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, ha->init_cb, sz); if (rval != QLA_SUCCESS) { |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:46:13
|
Commit: a1edff6 GitHub URL: https://github.com/SCST-project/scst/commit/a1edff66778872c41289926c064566e55310dc61 Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Check valid rport returned by fc_bsg_to_rport() Klocwork reported warning of rport maybe NULL and will be dereferenced. rport returned by call to fc_bsg_to_rport() could be NULL and dereferenced. Check valid rport returned by fc_bsg_to_rport(). Cc: st...@vg... Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit af73f23a2720 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_bsg.c | 4 ++++ 1 file changed, 4 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index 8e0f44c..25de9fb 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -286,6 +286,10 @@ qla2x00_process_els(BSG_JOB_TYPE *bsg_job) if (bsg_request->msgcode == FC_BSG_RPT_ELS) { rport = fc_bsg_to_rport(bsg_job); + if (!rport) { + rval = -ENOMEM; + goto done; + } fcport = *(fc_port_t **) rport->dd_data; host = rport_to_shost(rport); vha = shost_priv(host); |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:46:01
|
Commit: bb18381 GitHub URL: https://github.com/SCST-project/scst/commit/bb18381819785f93e24d7b6f12a727579ef63148 Author: Gleb Chesnokov Date: 2023-07-19T11:45:31+03:00 Log Message: ----------- qla2x00t-32gbit: Avoid fcport pointer dereference Klocwork reported warning of NULL pointer may be dereferenced. The routine exits when sa_ctl is NULL and fcport is allocated after the exit call thus causing NULL fcport pointer to dereference at the time of exit. To avoid fcport pointer dereference, exit the routine when sa_ctl is NULL. Cc: st...@vg... Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 6b504d06976f upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_edif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_edif.c b/qla2x00t-32gbit/qla_edif.c index 9e0fd61..96b45f6 100644 --- a/qla2x00t-32gbit/qla_edif.c +++ b/qla2x00t-32gbit/qla_edif.c @@ -2362,8 +2362,8 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e) if (!sa_ctl) { ql_dbg(ql_dbg_edif, vha, 0x70e6, "sa_ctl allocation failed\n"); - rval = -ENOMEM; - goto done; + rval = -ENOMEM; + return rval; } fcport = sa_ctl->fcport; |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:39:34
|
Commit: 0367c33 GitHub URL: https://github.com/SCST-project/scst/commit/0367c334c36aec8561218cfbab539160be993c66 Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Fix potential NULL pointer dereference Klocwork tool reported 'cur_dsd' may be dereferenced. Add fix to validate pointer before dereferencing the pointer. Cc: st...@vg... Signed-off-by: Bikash Hazarika <bha...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 464ea494a40c upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_iocb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index 2742d37..bdf505a 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -613,7 +613,8 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, put_unaligned_le32(COMMAND_TYPE_6, &cmd_pkt->entry_type); /* No data transfer */ - if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { + if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE || + tot_dsds == 0) { cmd_pkt->byte_count = cpu_to_le32(0); return 0; } |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:39:24
|
Commit: 0b9f73b GitHub URL: https://github.com/SCST-project/scst/commit/0b9f73b1d8dc3739dccd729329232f5ecbf8c201 Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Array index may go out of bound Klocwork reports array 'vha->host_str' of size 16 may use index value(s) 16..19. Use snprintf() instead of sprintf(). Cc: st...@vg... Co-developed-by: Bikash Hazarika <bha...@ma...> Signed-off-by: Bikash Hazarika <bha...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit d721b591b95c upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 7bd76e8..d83151d 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -5151,7 +5151,8 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, } INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); - sprintf(vha->host_str, "%s_%lu", QLA2XXX_DRIVER_NAME, vha->host_no); + snprintf(vha->host_str, sizeof(vha->host_str), "%s_%lu", + QLA2XXX_DRIVER_NAME, vha->host_no); ql_dbg(ql_dbg_init, vha, 0x0041, "Allocated the host=%p hw=%p vha=%p dev_name=%s", vha->host, vha->hw, vha, |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:39:08
|
Commit: 6aff6bf GitHub URL: https://github.com/SCST-project/scst/commit/6aff6bfacb0188b6627d79e0d09acab8a5552bdd Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Drop useless LIST_HEAD 'new_fcports' is unused, so drop it. Signed-off-by: Christophe JAILLET <chr...@wa...> Link: https://lore.kernel.org/r/49b...@wa... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 022000d3f586 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 1 - 1 file changed, 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 69719b6..3a5edf3 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -6223,7 +6223,6 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha) fc_port_t *fcport; uint16_t mb[MAILBOX_REGISTER_COUNT]; uint16_t loop_id; - LIST_HEAD(new_fcports); struct qla_hw_data *ha = vha->hw; int discovery_gen; |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:38:55
|
Commit: d74330a GitHub URL: https://github.com/SCST-project/scst/commit/d74330aed223228e2051050ae1875d3c5a78ebeb Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Backport to older kernel versions Unbreak the build for the previous commit against kernel versions before v5.16. See also commit 3080ea5553cc ("stddef: Introduce DECLARE_FLEX_ARRAY() helper") # v5.16. Modified Paths: -------------- scst/include/backport.h | 8 ++++++++ 1 file changed, 8 insertions(+) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 4e693ae..f4fc281 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1314,6 +1314,14 @@ static inline void __user *KERNEL_SOCKPTR(void *p) #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) #endif +#ifndef DECLARE_FLEX_ARRAY +#define DECLARE_FLEX_ARRAY(TYPE, NAME) \ + struct { \ + struct { } __empty_ ## NAME; \ + TYPE NAME[]; \ + } +#endif + /* <linux/string.h> */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) && \ |
From: Gleb C. <lna...@ya...> - 2023-07-19 08:38:43
|
Commit: cba2284 GitHub URL: https://github.com/SCST-project/scst/commit/cba2284cd167a62bb5d57b13af9f26573cf27a8a Author: Gleb Chesnokov Date: 2023-07-19T11:35:51+03:00 Log Message: ----------- qla2x00t-32gbit: Replace one-element array with DECLARE_FLEX_ARRAY() helper One-element arrays as fake flex arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace one-element array declaration in struct ct_sns_gpnft_rsp, which is ultimately being used inside a union: drivers/scsi/qla2xxx/qla_def.h: 3240 struct ct_sns_gpnft_pkt { 3241 union { 3242 struct ct_sns_req req; 3243 struct ct_sns_gpnft_rsp rsp; 3244 } p; 3245 }; Refactor the rest of the code, accordingly. This issue was found with the help of Coccinelle. Link: https://github.com/KSPP/linux/issues/245 Link: https://github.com/KSPP/linux/issues/193 Reviewed-by: Kees Cook <kee...@ch...> Signed-off-by: Gustavo A. R. Silva <gus...@ke...> Link: https://lore.kernel.org/r/ZH+/rZ1R1cBjIxjS@work Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 512a365368c7 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 4 ++-- qla2x00t-32gbit/qla_gs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 433d9a8..4a496a6 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -3226,12 +3226,12 @@ struct ct_sns_gpnft_rsp { uint8_t vendor_unique; }; /* Assume the largest number of targets for the union */ - struct ct_sns_gpn_ft_data { + DECLARE_FLEX_ARRAY(struct ct_sns_gpn_ft_data { u8 control_byte; u8 port_id[3]; u32 reserved; u8 port_name[8]; - } entries[1]; + }, entries); }; /* CT command response */ diff --git a/qla2x00t-32gbit/qla_gs.c b/qla2x00t-32gbit/qla_gs.c index 4738f89..1cf9d20 100644 --- a/qla2x00t-32gbit/qla_gs.c +++ b/qla2x00t-32gbit/qla_gs.c @@ -3776,8 +3776,8 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) sp->u.iocb_cmd.u.ctarg.req_size = GPN_FT_REQ_SIZE; rspsz = sizeof(struct ct_sns_gpnft_rsp) + - ((vha->hw->max_fibre_devices - 1) * - sizeof(struct ct_sns_gpn_ft_data)); + vha->hw->max_fibre_devices * + sizeof(struct ct_sns_gpn_ft_data); sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, rspsz, |