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
(18) |
Oct
(1) |
Nov
(18) |
Dec
(15) |
2025 |
Jan
(5) |
Feb
(1) |
Mar
(7) |
Apr
(4) |
May
(18) |
Jun
(7) |
Jul
|
Aug
(17) |
Sep
(13) |
Oct
(7) |
Nov
|
Dec
|
From: Gleb C. <lna...@ya...> - 2024-09-04 11:37:03
|
Commit: d002f0a GitHub URL: https://github.com/SCST-project/scst/commit/d002f0afd58a221224c9b2e96fe71e5cec4ef2bb Author: Gleb Chesnokov Date: 2024-09-04T14:34:12+03:00 Log Message: ----------- qla2x00t-32gbit: validate nvme_local_port correctly The driver load failed with error message, qla2xxx [0000:04:00.0]-ffff:0: register_localport failed: ret=ffffffef and with a kernel crash, BUG: unable to handle kernel NULL pointer dereference at 0000000000000070 Workqueue: events_unbound qla_register_fcport_fn [qla2xxx] RIP: 0010:nvme_fc_register_remoteport+0x16/0x430 [nvme_fc] RSP: 0018:ffffaaa040eb3d98 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff9dfb46b78c00 RCX: 0000000000000000 RDX: ffff9dfb46b78da8 RSI: ffffaaa040eb3e08 RDI: 0000000000000000 RBP: ffff9dfb612a0a58 R08: ffffffffaf1d6270 R09: 3a34303a30303030 R10: 34303a303030305b R11: 2078787832616c71 R12: ffff9dfb46b78dd4 R13: ffff9dfb46b78c24 R14: ffff9dfb41525300 R15: ffff9dfb46b78da8 FS: 0000000000000000(0000) GS:ffff9dfc67c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000070 CR3: 000000018da10004 CR4: 00000000000206f0 Call Trace: qla_nvme_register_remote+0xeb/0x1f0 [qla2xxx] ? qla2x00_dfs_create_rport+0x231/0x270 [qla2xxx] qla2x00_update_fcport+0x2a1/0x3c0 [qla2xxx] qla_register_fcport_fn+0x54/0xc0 [qla2xxx] Exit the qla_nvme_register_remote() function when qla_nvme_register_hba() fails and correctly validate nvme_local_port. 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 eb1d4ce26095 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_nvme.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index e0a9a4f..038c10e 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -56,7 +56,10 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return 0; } - if (!vha->nvme_local_port && qla_nvme_register_hba(vha)) + if (qla_nvme_register_hba(vha)) + return 0; + + if (!vha->nvme_local_port) return 0; if (!(fcport->nvme_prli_service_param & |
From: Gleb C. <lna...@ya...> - 2024-09-04 11:36:57
|
Commit: 1e5f77a GitHub URL: https://github.com/SCST-project/scst/commit/1e5f77a9312f582eb3e55f5b44ba5cb6c5f9811a Author: Gleb Chesnokov Date: 2024-09-04T14:34:12+03:00 Log Message: ----------- qla2x00t-32gbit: Unable to act on RSCN for port online The device does not come online when the target port is online. There were multiple RSCNs indicating multiple devices were affected. Driver is in the process of finishing a fabric scan. A new RSCN (device up) arrived at the tail end of the last fabric scan. Driver mistakenly thinks the new RSCN is being taken care of by the previous fabric scan, where this notification is cleared and not acted on. The laser needs to be blinked again to get the device to show up. To prevent driver from accidentally clearing the RSCN notification, each RSCN is given a generation value. A fabric scan will scan for that generation(s). Any new RSCN arrive after the scan start will have a new generation value. This will trigger another scan to get latest data. The RSCN notification flag will be cleared when the scan is associate to that generation. Reported-by: kernel test robot <lk...@in...> Closes: https://lore.kernel.org/oe-kbuild-all/202...@in.../ Fixes: bb2ca6b3f09a ("scsi: qla2xxx: Relogin during fabric disturbance") 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 c3d98b12eef8 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 3 ++ qla2x00t-32gbit/qla_gs.c | 33 +++++++++++++-- qla2x00t-32gbit/qla_init.c | 24 ++++++++--- qla2x00t-32gbit/qla_inline.h | 8 ++++ 4 files changed, 60 insertions(+), 8 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index a777885..c3fd03d 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -3368,6 +3368,8 @@ struct fab_scan_rp { struct fab_scan { struct fab_scan_rp *l; u32 size; + u32 rscn_gen_start; + u32 rscn_gen_end; u16 scan_retry; #define MAX_SCAN_RETRIES 5 enum scan_flags_t scan_flags; @@ -5088,6 +5090,7 @@ typedef struct scsi_qla_host { /* Counter to detect races between ELS and RSCN events */ atomic_t generation_tick; + atomic_t rscn_gen; /* Time when global fcport update has been scheduled */ int total_fcport_update_gen; /* List of pending LOGOs, protected by tgt_mutex */ diff --git a/qla2x00t-32gbit/qla_gs.c b/qla2x00t-32gbit/qla_gs.c index 1cf9d20..e801cd9 100644 --- a/qla2x00t-32gbit/qla_gs.c +++ b/qla2x00t-32gbit/qla_gs.c @@ -3168,6 +3168,29 @@ static int qla2x00_is_a_vp(scsi_qla_host_t *vha, u64 wwn) return rc; } +static bool qla_ok_to_clear_rscn(scsi_qla_host_t *vha, fc_port_t *fcport) +{ + u32 rscn_gen; + + rscn_gen = atomic_read(&vha->rscn_gen); + ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x2017, + "%s %d %8phC rscn_gen %x start %x end %x current %x\n", + __func__, __LINE__, fcport->port_name, fcport->rscn_gen, + vha->scan.rscn_gen_start, vha->scan.rscn_gen_end, rscn_gen); + + if (val_is_in_range(fcport->rscn_gen, vha->scan.rscn_gen_start, + vha->scan.rscn_gen_end)) + /* rscn came in before fabric scan */ + return true; + + if (val_is_in_range(fcport->rscn_gen, vha->scan.rscn_gen_end, rscn_gen)) + /* rscn came in after fabric scan */ + return false; + + /* rare: fcport's scan_needed + rscn_gen must be stale */ + return true; +} + void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) { fc_port_t *fcport; @@ -3281,10 +3304,10 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) (fcport->scan_needed && fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_NVME_INITIATOR)) { + fcport->scan_needed = 0; qlt_schedule_sess_for_deletion(fcport); } fcport->d_id.b24 = rp->id.b24; - fcport->scan_needed = 0; break; } @@ -3325,7 +3348,9 @@ login_logout: do_delete = true; } - fcport->scan_needed = 0; + if (qla_ok_to_clear_rscn(vha, fcport)) + fcport->scan_needed = 0; + if (((qla_dual_mode_enabled(vha) || qla_ini_mode_enabled(vha)) && atomic_read(&fcport->state) == FCS_ONLINE) || @@ -3355,7 +3380,9 @@ login_logout: fcport->port_name, fcport->loop_id, fcport->login_retry); } - fcport->scan_needed = 0; + + if (qla_ok_to_clear_rscn(vha, fcport)) + fcport->scan_needed = 0; qla24xx_fcport_handle_login(vha, fcport); } } diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 6a1af56..f66e18d 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -1842,10 +1842,18 @@ int qla24xx_post_newsess_work(struct scsi_qla_host *vha, port_id_t *id, return qla2x00_post_work(vha, e); } +static void qla_rscn_gen_tick(scsi_qla_host_t *vha, u32 *ret_rscn_gen) +{ + *ret_rscn_gen = atomic_inc_return(&vha->rscn_gen); + /* memory barrier */ + wmb(); +} + void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) { fc_port_t *fcport; unsigned long flags; + u32 rscn_gen; switch (ea->id.b.rsvd_1) { case RSCN_PORT_ADDR: @@ -1875,15 +1883,16 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) * Otherwise we're already in the middle of a relogin */ fcport->scan_needed = 1; - fcport->rscn_gen++; + qla_rscn_gen_tick(vha, &fcport->rscn_gen); } } else { fcport->scan_needed = 1; - fcport->rscn_gen++; + qla_rscn_gen_tick(vha, &fcport->rscn_gen); } } break; case RSCN_AREA_ADDR: + qla_rscn_gen_tick(vha, &rscn_gen); list_for_each_entry(fcport, &vha->vp_fcports, list) { if (fcport->flags & FCF_FCP2_DEVICE && atomic_read(&fcport->state) == FCS_ONLINE) @@ -1891,11 +1900,12 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) { fcport->scan_needed = 1; - fcport->rscn_gen++; + fcport->rscn_gen = rscn_gen; } } break; case RSCN_DOM_ADDR: + qla_rscn_gen_tick(vha, &rscn_gen); list_for_each_entry(fcport, &vha->vp_fcports, list) { if (fcport->flags & FCF_FCP2_DEVICE && atomic_read(&fcport->state) == FCS_ONLINE) @@ -1903,19 +1913,20 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) { fcport->scan_needed = 1; - fcport->rscn_gen++; + fcport->rscn_gen = rscn_gen; } } break; case RSCN_FAB_ADDR: default: + qla_rscn_gen_tick(vha, &rscn_gen); list_for_each_entry(fcport, &vha->vp_fcports, list) { if (fcport->flags & FCF_FCP2_DEVICE && atomic_read(&fcport->state) == FCS_ONLINE) continue; fcport->scan_needed = 1; - fcport->rscn_gen++; + fcport->rscn_gen = rscn_gen; } break; } @@ -1924,6 +1935,7 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) if (vha->scan.scan_flags == 0) { ql_dbg(ql_dbg_disc, vha, 0xffff, "%s: schedule\n", __func__); vha->scan.scan_flags |= SF_QUEUED; + vha->scan.rscn_gen_start = atomic_read(&vha->rscn_gen); schedule_delayed_work(&vha->scan.scan_work, 5); } spin_unlock_irqrestore(&vha->work_lock, flags); @@ -6396,6 +6408,8 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha) qlt_do_generation_tick(vha, &discovery_gen); if (USE_ASYNC_SCAN(ha)) { + /* start of scan begins here */ + vha->scan.rscn_gen_end = atomic_read(&vha->rscn_gen); rval = qla24xx_async_gpnft(vha, FC4_TYPE_FCP_SCSI, NULL); if (rval) diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index 8746184..ebb33cf 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -643,3 +643,11 @@ static inline int qla_mapq_alloc_qp_cpu_map(struct qla_hw_data *ha) } return 0; } + +static inline bool val_is_in_range(u32 val, u32 start, u32 end) +{ + if (val >= start && val <= end) + return true; + else + return false; +} |
From: Gleb C. <lna...@ya...> - 2024-09-04 11:36:27
|
Commit: e73abbd GitHub URL: https://github.com/SCST-project/scst/commit/e73abbd6b8503fa98d7f477e9cd9bdc1b081f9b4 Author: Gleb Chesnokov Date: 2024-09-04T14:34:12+03:00 Log Message: ----------- qla2x00t-32gbit: Remove unused struct 'scsi_dif_tuple' 'scsi_dif_tuple' is unused since commit 8cb2049c7448 ("[SCSI] qla2xxx: T10 DIF - Handle uninitalized sectors."). Remove it. Signed-off-by: Dr. David Alan Gilbert <li...@tr...> Link: https://lore.kernel.org/r/202...@tr... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 96281dfa266d upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_isr.c | 6 ------ 1 file changed, 6 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index a6209b2..913152b 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3037,12 +3037,6 @@ qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len, } } -struct scsi_dif_tuple { - __be16 guard; /* Checksum */ - __be16 app_tag; /* APPL identifier */ - __be32 ref_tag; /* Target LBA or indirect LBA */ -}; - /* * Checks the guard or meta-data for the type of error * detected by the HBA. In case of errors, we set the |
From: Gleb C. <lna...@ya...> - 2024-09-04 09:56:55
|
Commit: 667ef76 GitHub URL: https://github.com/SCST-project/scst/commit/667ef768a049a1c70d607419fc46eb15003d7ba1 Author: Gleb Chesnokov Date: 2024-09-04T12:54:26+03:00 Log Message: ----------- scst_local: Port to Linux kernel v6.11 Support for the following driver core changes in the Linux kernel v6.11: - d69d80484598 ("driver core: have match() callback in struct bus_type take a const *") Modified Paths: -------------- scst_local/scst_local.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 0e0efed..9021532 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1500,8 +1500,11 @@ static DRIVER_REMOVE_RET scst_local_driver_remove(struct device *dev) return (DRIVER_REMOVE_RET)0; } -static int scst_local_bus_match(struct device *dev, - struct device_driver *dev_driver) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) +static int scst_local_bus_match(struct device *dev, struct device_driver *drv) +#else +static int scst_local_bus_match(struct device *dev, const struct device_driver *drv) +#endif { TRACE_ENTRY(); |
From: Gleb C. <lna...@ya...> - 2024-09-04 09:56:47
|
Commit: ec1b85a GitHub URL: https://github.com/SCST-project/scst/commit/ec1b85a7e1a221b15192a83998c783b637ef37ac Author: Gleb Chesnokov Date: 2024-09-04T12:54:26+03:00 Log Message: ----------- scst_vdisk: Port to Linux kernel v6.11 Support for the following block layer changes in the Linux kernel v6.11: - e9f5f44ad372 ("block: remove the blk_integrity_profile structure") Modified Paths: -------------- scst/src/dev_handlers/scst_vdisk.c | 39 ++++++++------- 1 file changed, 21 insertions(+), 18 deletions(-) =================================================================== diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 4f65d1a..0234743 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -983,48 +983,51 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) bi_profile_name = bi->name; -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) bi_profile_name = bi->profile->name; +#else + bi_profile_name = blk_integrity_profile_name(bi); #endif + TRACE_DBG("BI name %s", bi_profile_name); if (!strcmp(bi_profile_name, "T10-DIF-TYPE1-CRC")) { dev->dev_dif_ip_not_supported = 1; if (virt_dev->dif_type != 1) { - PRINT_ERROR("Integrity type mismatch, %d expected, " - "but block device has 1 (dev %s)", - virt_dev->dif_type, dev->virt_name); + PRINT_ERROR( + "Integrity type mismatch, %d expected, but block device has 1 (dev %s)", + virt_dev->dif_type, dev->virt_name); res = -EINVAL; goto out_close; } } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE1-IP")) { if (virt_dev->dif_type != 1) { - PRINT_ERROR("Integrity type mismatch, %d expected, " - "but block device has 1 (dev %s)", - virt_dev->dif_type, dev->virt_name); + PRINT_ERROR( + "Integrity type mismatch, %d expected, but block device has 1 (dev %s)", + virt_dev->dif_type, dev->virt_name); res = -EINVAL; goto out_close; } } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE3-CRC")) { dev->dev_dif_ip_not_supported = 1; if (virt_dev->dif_type != 3) { - PRINT_ERROR("Integrity type mismatch, %d expected, " - "but block device has 1 (dev %s)", - virt_dev->dif_type, dev->virt_name); + PRINT_ERROR( + "Integrity type mismatch, %d expected, but block device has 1 (dev %s)", + virt_dev->dif_type, dev->virt_name); res = -EINVAL; goto out_close; } } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE3-IP")) { if (virt_dev->dif_type != 3) { - PRINT_ERROR("Integrity type mismatch, %d expected, " - "but block device has 3 (dev %s)", - virt_dev->dif_type, dev->virt_name); + PRINT_ERROR( + "Integrity type mismatch, %d expected, but block device has 3 (dev %s)", + virt_dev->dif_type, dev->virt_name); res = -EINVAL; goto out_close; } } else { - PRINT_ERROR("Unable to understand integrity name %s" - "(dev %s)", bi_profile_name, dev->virt_name); + PRINT_ERROR("Unable to understand integrity name %s (dev %s)", + bi_profile_name, dev->virt_name); res = -EINVAL; goto out_close; } @@ -1033,15 +1036,15 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev) if ((virt_dev->dif_mode & SCST_DIF_MODE_DEV_CHECK) && !(virt_dev->dif_mode & SCST_DIF_MODE_DEV_STORE)) { - PRINT_ERROR("Blockio dev_check is not possible without " - "dev_store (dev %s)", dev->virt_name); + PRINT_ERROR("Blockio dev_check is not possible without dev_store (dev %s)", + dev->virt_name); res = -EINVAL; goto out_close; } if (!(virt_dev->dif_mode & SCST_DIF_MODE_DEV_CHECK)) PRINT_WARNING("Blk integrity implies dev_check (dev %s)", - dev->virt_name); + dev->virt_name); out_no_bi: res = 0; |
From: Gleb C. <lna...@ya...> - 2024-09-04 09:54:57
|
Commit: 8c6a968 GitHub URL: https://github.com/SCST-project/scst/commit/8c6a9680830e642958eb93add863db5913cc359b Author: Gleb Chesnokov Date: 2024-09-04T12:54:26+03:00 Log Message: ----------- scst_lib: Port to Linux kernel v6.11 Support for the following block layer changes in the Linux kernel v6.11: - e94b45d08b5d ("block: move dma_pad_mask into queue_limits") Modified Paths: -------------- scst/src/scst_lib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index c9d60c7..551afba 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8431,6 +8431,16 @@ static struct request *blk_make_request(struct request_queue *q, } #endif +static inline unsigned int +queue_dma_pad_mask(const struct request_queue *q) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) + return q->dma_pad_mask; +#else + return q->limits.dma_pad_mask; +#endif +} + /* __blk_map_kern_sg - map kernel data to a request for REQ_TYPE_BLOCK_PC */ static struct request *__blk_map_kern_sg(struct request_queue *q, struct scatterlist *sgl, int nents, struct blk_kern_sg_work *bw, @@ -8553,7 +8563,7 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, } /* Total length must satisfy DMA padding alignment */ - if ((tot_len & q->dma_pad_mask) && bw != NULL) { + if (bw && (tot_len & queue_dma_pad_mask(q))) { rq = ERR_PTR(-EINVAL); goto out_free_bios; } |
From: Gleb C. <lna...@ya...> - 2024-08-19 14:13:26
|
Commit: aa086c9 GitHub URL: https://github.com/SCST-project/scst/commit/aa086c9fb39bc608bacec2d2b656e65713cdae85 Author: Brian M Date: 2024-08-19T17:13:00+03:00 Log Message: ----------- iscsi-scst: Add internal_portal parameter Add an internal_portal parameter to allow specified portals to bypass CHAP controls for both discovery and target login. If not populated, then the current behavior will be preserved. Modified Paths: -------------- iscsi-scst/README | 8 ++ iscsi-scst/usr/event.c | 65 +++++++++++++++ iscsi-scst/usr/iscsi_scstd.c | 3 + iscsi-scst/usr/iscsid.c | 30 ++++++- iscsi-scst/usr/iscsid.h | 1 + iscsi-scst/usr/param.h | 1 + 6 files changed, 107 insertions(+), 1 deletion(-) =================================================================== diff --git a/iscsi-scst/README b/iscsi-scst/README index 4a275b1..91ad191 100644 --- a/iscsi-scst/README +++ b/iscsi-scst/README @@ -200,6 +200,13 @@ is /sys/kernel/scst_tgt/targets/iscsi. It has the following entries: iSCSI-SCST attributes before it starts accepting new connections. 0 by default. + - internal_portal - May designate one or more existing portals as being + internal. This will eliminate the need to supply a CHAP user/secret + during discovery or target login to any targets configured on those + portals. This is particularly useful for internal targets used as + part of ALUA configuration. Multiple addresses may be supplied, + separated by space characters. Empty by default. + - link_local - if set, makes the response to an IPv6 SendTargets include any link local addresses. Default is set. @@ -552,6 +559,7 @@ both iSCSI-SCST targets will look like: | |-- IncomingUser | |-- OutgoingUser | |-- enabled +| |-- internal_portal | |-- iSNSServer | |-- iqn.2006-10.net.vlnb:tgt | | |-- DataDigest diff --git a/iscsi-scst/usr/event.c b/iscsi-scst/usr/event.c index a65a183..b2178ae 100644 --- a/iscsi-scst/usr/event.c +++ b/iscsi-scst/usr/event.c @@ -654,6 +654,18 @@ static int handle_e_get_attr_value(int fd, const struct iscsi_kern_event *event) snprintf(res_str, sizeof(res_str), "%d\n", send_targets_link_local); if (send_targets_link_local != DEFAULT_SEND_TARGETS_LINK_LOCAL) add_key_mark(res_str, sizeof(res_str), 0); + } else if (strcasecmp(ISCSI_INTERNAL_PORTAL_ATTR_NAME, pp) == 0) { + if (target != NULL) { + log_error("Not NULL target %s for global attribute %s", + target->name, pp); + res = -EINVAL; + goto out_free; + } + if (internal_portal) { + snprintf(res_str, sizeof(res_str), "%s\n", internal_portal); + add_key_mark(res_str, sizeof(res_str), 0); + } else + snprintf(res_str, sizeof(res_str), "\n"); } else { log_error("Unknown attribute %s", pp); res = -EINVAL; @@ -669,6 +681,14 @@ out: return res; } +static bool is_addr(char *addr) +{ + struct in_addr ia; + struct in6_addr ia6; + + return (inet_pton(AF_INET, addr, &ia) == 1) || inet_pton(AF_INET6, addr, &ia6); +} + static int handle_target_redirect(struct target *target, char *p) { int res = 0; @@ -1094,6 +1114,51 @@ static int handle_e_set_attr_value(int fd, const struct iscsi_kern_event *event) res = -EINVAL; goto out_free; } + } else if (strcasecmp(ISCSI_INTERNAL_PORTAL_ATTR_NAME, pp) == 0) { + if (target != NULL) { + log_error("Not NULL target %s for global attribute %s", + target->name, pp); + res = -EINVAL; + goto out_free; + } + p = config_strip_string(p); + if (!p || *p == '\0') { + free(internal_portal); + internal_portal = NULL; + } else { + /* We have been provided with a string, check the contents. */ + if (strchr(p, ' ')) { + char *portals = strdup(p); + char *portal; + + if (!portals) { + log_error("Memory error (internal_portal)"); + res = -ENOMEM; + goto out_free; + } + + portal = strtok(portals, " "); + while (portal != NULL) { + if (!is_addr(portal)) { + free(portals); + log_error("Invalid address supplied %s", portal); + res = -EINVAL; + goto out_free; + } + portal = strtok(NULL, " "); + } + free(portals); + } else { + /* No spaces */ + if (!is_addr(p)) { + log_error("Invalid address supplied %s", p); + res = -EINVAL; + goto out_free; + } + } + free(internal_portal); + internal_portal = strdup(p); + } } else { log_error("Unknown attribute %s", pp); res = -EINVAL; diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index 97b9143..60b8309 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -962,6 +962,9 @@ int main(int argc, char **argv) if (err != 0) exit(err); err = kernel_attr_add(NULL, ISCSI_LINK_LOCAL_ATTR_NAME, 0644, 0); + if (err != 0) + exit(err); + err = kernel_attr_add(NULL, ISCSI_INTERNAL_PORTAL_ATTR_NAME, 0644, 0); if (err != 0) exit(err); diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index 1ef94ce..d32b672 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -27,6 +27,7 @@ #include "iscsid.h" int iscsi_enabled; +char *internal_portal; static u32 ttt; @@ -1011,6 +1012,32 @@ static int cmnd_exec_auth(struct connection *conn) return res; } +static bool on_internal_portal(struct connection *conn) +{ + if (!internal_portal) + return false; + + if (strchr(internal_portal, ' ')) { + char *portals = strdup(internal_portal); + + if (portals) { + char *portal = strtok(portals, " "); + + while (portal != NULL) { + if (!strcmp(portal, conn->target_portal)) { + free(portals); + return true; + } + portal = strtok(NULL, " "); + } + free(portals); + } + return false; + } else { + return !strcmp(internal_portal, conn->target_portal); + } +} + static void cmnd_exec_login(struct connection *conn) { struct iscsi_login_req_hdr *req = (struct iscsi_login_req_hdr *)&conn->req.bhs; @@ -1083,7 +1110,8 @@ static void cmnd_exec_login(struct connection *conn) login_start(conn); if (rsp->status_class) return; - if (!accounts_empty(conn->tid, ISCSI_USER_DIR_INCOMING)) + if (!accounts_empty(conn->tid, ISCSI_USER_DIR_INCOMING) && + !on_internal_portal(conn)) goto auth_err; if (rsp->status_class) return; diff --git a/iscsi-scst/usr/iscsid.h b/iscsi-scst/usr/iscsid.h index e68f67d..b3beb3a 100644 --- a/iscsi-scst/usr/iscsid.h +++ b/iscsi-scst/usr/iscsid.h @@ -265,6 +265,7 @@ extern const char *get_error_str(int error); /* iscsid.c */ extern int iscsi_enabled; +extern char *internal_portal; extern int cmnd_execute(struct connection *conn); extern void cmnd_finish(struct connection *conn); diff --git a/iscsi-scst/usr/param.h b/iscsi-scst/usr/param.h index 9c9c62a..e936c25 100644 --- a/iscsi-scst/usr/param.h +++ b/iscsi-scst/usr/param.h @@ -21,6 +21,7 @@ #define ISCSI_ENABLED_ATTR_NAME "enabled" #define ISCSI_ISNS_ENTITY_ATTR_NAME "isns_entity_name" #define ISCSI_ALLOWED_PORTAL_ATTR_NAME "allowed_portal" +#define ISCSI_INTERNAL_PORTAL_ATTR_NAME "internal_portal" #define ISCSI_PER_PORTAL_ACL_ATTR_NAME "per_portal_acl" #define ISCSI_TARGET_REDIRECTION_ATTR_NAME "redirect" #define ISCSI_TARGET_REDIRECTION_VALUE_TEMP "temp" |
From: Gleb C. <lna...@ya...> - 2024-08-19 08:11:01
|
Commit: 0b00e0a GitHub URL: https://github.com/SCST-project/scst/commit/0b00e0af96674a9942021ebabfabadfc370b3e04 Author: Gleb Chesnokov Date: 2024-08-19T11:10:34+03:00 Log Message: ----------- scst_lib: Fix VPD inquiry handling on incorrect LUNs When SCST receives an INQUIRY request for an incorrect LUN, it calls scst_set_lun_not_supported_inquiry(), which returns an inquiry buffer with a peripheral qualifier of 011b and a peripheral device type of 1Fh. However, for a VPD inquiry, it is unable to populate the remaining fields. According to SPC-6, if the device server cannot return the requested data, it should terminate with CHECK CONDITION. Reported-by: Lev Vainblat <le...@za...> Modified Paths: -------------- scst/src/scst_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index ba776be..c9d60c7 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2094,7 +2094,7 @@ int scst_set_cmd_error(struct scst_cmd *cmd, int key, int asc, int ascq) if (cmd->cdb[0] == REQUEST_SENSE) res = scst_set_lun_not_supported_request_sense(cmd, key, asc, ascq); - else if (cmd->cdb[0] == INQUIRY) + else if (cmd->cdb[0] == INQUIRY && !(cmd->cdb[1] & 0x01/*EVPD*/)) res = scst_set_lun_not_supported_inquiry(cmd); else if (cmd->cdb[0] == REPORT_LUNS) res = scst_set_lun_not_supported_report_luns(cmd); |
From: Gleb C. <lna...@ya...> - 2024-07-15 12:20:45
|
Commit: 7117490 GitHub URL: https://github.com/SCST-project/scst/commit/71174909108626f248c9eda2cb2037e00fcc97ff Author: Gleb Chesnokov Date: 2024-07-15T15:18:16+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 17 ++++++++------- nightly/conf/nightly.conf | 17 ++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index b63b2ec..13ac3e2 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -14,15 +14,16 @@ jobs: fail-fast: false matrix: version: [ - '6.9', - '6.8.9', + '6.10', + '6.9.9', + '6.8.12', '6.7.12', - '6.6.30', - '6.1.90', - '5.15.158', - '5.10.216', - '5.4.275', - '4.19.313', + '6.6.40', + '6.1.99', + '5.15.162', + '5.10.221', + '5.4.279', + '4.19.317', '4.14.336', '4.9.337', '3.18.140', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index e31dd09..9e9dce2 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.9 \ -6.8.9-nc \ +6.10 \ +6.9.9-nc \ +6.8.12-nc \ 6.7.12-nc \ -6.6.30-nc \ +6.6.40-nc \ 6.5.13-nc \ 6.4.16-nc \ 6.3.13-nc \ 6.2.16-nc \ -6.1.90-nc \ +6.1.99-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.158-nc \ +5.15.162-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.216-nc \ +5.10.221-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.275-nc \ +5.4.279-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.313-nc \ +4.19.317-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ |
From: Gleb C. <lna...@ya...> - 2024-07-15 12:18:46
|
Commit: faa8f46 GitHub URL: https://github.com/SCST-project/scst/commit/faa8f460d7b7b5206d2c34e5d901a378d73f689f Author: Gleb Chesnokov Date: 2024-07-15T15:18:16+03:00 Log Message: ----------- scst_local, qla2x00t-32gbit: Improve Linux kernel 6.10 porting Fix compilation warnings, errors. Modified Paths: -------------- qla2x00t-32gbit/include/trace/events/qla.h | 15 +++++++++++++++ scst_local/scst_local.c | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/include/trace/events/qla.h b/qla2x00t-32gbit/include/trace/events/qla.h index e3b4700..8708519 100644 --- a/qla2x00t-32gbit/include/trace/events/qla.h +++ b/qla2x00t-32gbit/include/trace/events/qla.h @@ -2,6 +2,9 @@ #if !defined(_TRACE_QLA_H_) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_QLA_H_ +#ifndef INSIDE_KERNEL_TREE +#include <linux/version.h> +#endif #include <linux/tracepoint.h> #undef TRACE_SYSTEM @@ -22,11 +25,23 @@ DECLARE_EVENT_CLASS(qla_log_event, TP_STRUCT__entry( __string(buf, buf) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) __dynamic_array(char, msg, QLA_MSG_MAX) +#else + __vstring(msg, vaf->fmt, vaf->va) +#endif ), TP_fast_assign( +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) __assign_str(buf, buf); +#else + __assign_str(buf); +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) vsnprintf(__get_str(msg), QLA_MSG_MAX, vaf->fmt, *vaf->va); +#else + __assign_vstr(msg, vaf->fmt, vaf->va); +#endif ), TP_printk("%s %s", __get_str(buf), __get_str(msg)) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 6cd11f7..0e0efed 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1033,6 +1033,7 @@ out: #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) static int scst_local_slave_alloc(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; @@ -1048,17 +1049,16 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ blk_queue_dma_alignment(q, (4096 - 1)); -#endif return 0; } +#endif static int scst_local_slave_configure(struct scsi_device *sdev) { @@ -1381,10 +1381,11 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) + .slave_alloc = scst_local_slave_alloc, +#else .dma_alignment = (4096 - 1), #endif - .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, .eh_device_reset_handler = scst_local_device_reset, |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:59:52
|
Commit: 40675cf GitHub URL: https://github.com/SCST-project/scst/commit/40675cf67d5f322344855c5161950bf920e37841 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Fix debugfs output for fw_resource_count DebugFS output for fw_resource_count shows: estimate exchange used[0] high water limit [1945] n estimate iocb2 used [0] high water limit [5141] estimate exchange2 used[0] high water limit [1945] Which shows incorrect display due to missing newline in seq_print(). [mkp: fix checkpatch warning about space before newline] Fixes: 5f63a163ed2f ("scsi: qla2xxx: Fix exchange oversubscription for management commands") Signed-off-by: Himanshu Madhani <him...@or...> Link: https://lore.kernel.org/r/202...@or... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 998d09c5ef61 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_dfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_dfs.c b/qla2x00t-32gbit/qla_dfs.c index a4715de..51e1d14 100644 --- a/qla2x00t-32gbit/qla_dfs.c +++ b/qla2x00t-32gbit/qla_dfs.c @@ -278,7 +278,7 @@ qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused) seq_printf(s, "Driver: estimate iocb used [%d] high water limit [%d]\n", iocbs_used, ha->base_qpair->fwres.iocbs_limit); - seq_printf(s, "estimate exchange used[%d] high water limit [%d] n", + seq_printf(s, "estimate exchange used[%d] high water limit [%d]\n", exch_used, ha->base_qpair->fwres.exch_limit); if (ql2xenforce_iocb_limit == 2) { |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:59:27
|
Commit: ceba304 GitHub URL: https://github.com/SCST-project/scst/commit/ceba304d08ccf034b8198552bc85d2c636961951 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Avoid possible run-time warning with long model_num The prior strlcpy() replacement of strncpy() here (which was later replaced with strscpy()) expected pinfo->model_num (and pinfo->model_description) to be NUL-terminated, but it is possible it was not, as the code pattern here shows vha->hw->model_number (and vha->hw->model_desc) being exactly 1 character larger, and the replaced strncpy() was copying only up to the size of the source character array. Replace this with memtostr(), which is the unambiguous way to convert a maybe not-NUL-terminated character array into a NUL-terminated string. Fixes: 527e9b704c3d ("scsi: qla2xxx: Use memcpy() and strlcpy() instead of strcpy() and strncpy()") Reviewed-by: Martin K. Petersen <mar...@or...> Link: https://lore.kernel.org/r/202...@ch... Signed-off-by: Kees Cook <kee...@ch...> [ commit c3408c4ae041 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_mr.c | 6 ++--- scst/include/backport.h | 19 +++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_mr.c b/qla2x00t-32gbit/qla_mr.c index ba12fdc..08c5fa6 100644 --- a/qla2x00t-32gbit/qla_mr.c +++ b/qla2x00t-32gbit/qla_mr.c @@ -1919,10 +1919,8 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) if (fx_type == FXDISC_GET_CONFIG_INFO) { struct config_info_data *pinfo = (struct config_info_data *) fdisc->u.fxiocb.rsp_addr; - strscpy(vha->hw->model_number, pinfo->model_num, - ARRAY_SIZE(vha->hw->model_number)); - strscpy(vha->hw->model_desc, pinfo->model_description, - ARRAY_SIZE(vha->hw->model_desc)); + memtostr(vha->hw->model_number, pinfo->model_num); + memtostr(vha->hw->model_desc, pinfo->model_description); memcpy(&vha->hw->mr.symbolic_name, pinfo->symbolic_name, sizeof(vha->hw->mr.symbolic_name)); memcpy(&vha->hw->mr.serial_num, pinfo->serial_num, diff --git a/scst/include/backport.h b/scst/include/backport.h index 7967508..7c53e9d 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1510,6 +1510,25 @@ static inline ssize_t strscpy(char *dest, const char *src, size_t count) } #endif +#ifndef memtostr +/* + * See also commit 0efc5990bca5 ("string.h: Introduce memtostr() and memtostr_pad()") # v6.10. + */ +#define memtostr(dest, src) do { \ + const size_t _dest_len = __builtin_object_size(dest, 1); \ + const size_t _src_len = __builtin_object_size(src, 1); \ + const size_t _src_chars = strnlen(src, _src_len); \ + const size_t _copy_len = min(_dest_len - 1, _src_chars); \ + \ + BUILD_BUG_ON(!__builtin_constant_p(_dest_len) || \ + !__builtin_constant_p(_src_len) || \ + _dest_len == 0 || _dest_len == (size_t)-1 || \ + _src_len == 0 || _src_len == (size_t)-1); \ + memcpy(dest, src, _copy_len); \ + dest[_copy_len] = '\0'; \ +} while (0) +#endif + /* <linux/sysfs.h> */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) && \ |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:54:49
|
Commit: d776e70 GitHub URL: https://github.com/SCST-project/scst/commit/d776e70d5c0ba87ca955a00fc346e3c9bf8ec5b3 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Drop driver owner assignment PCI core in pci_register_driver() already sets the .owner, so driver does not need to. Signed-off-by: Krzysztof Kozlowski <krz...@li...> Link: https://lore.kernel.org/r/202...@li... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 4e64bbba5352 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 3 --- 1 file changed, 3 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index d0d3bae..6c6ff1e 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -8309,9 +8309,6 @@ MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); static struct pci_driver qla2xxx_pci_driver = { .name = QLA2XXX_DRIVER_NAME, - .driver = { - .owner = THIS_MODULE, - }, .id_table = qla2xxx_pci_tbl, .probe = qla2x00_probe_one, .remove = qla2x00_remove_one, |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:48:06
|
Commit: c3bd33a GitHub URL: https://github.com/SCST-project/scst/commit/c3bd33a34f88180af97069db496590760d8c5030 Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- qla2x00t-32gbit, scst_local: Port to Linux kernel v6.10 Support for the following scsi layer changes in the Linux kernel v6.10: - 5b7dfbeff92a ("scsi: core: Add a dma_alignment field to the host and host template") Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 7 +++++++ scst_local/scst_local.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 20742d2..d0d3bae 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -2002,8 +2002,10 @@ qla2xxx_slave_configure(struct scsi_device *sdev) scsi_qla_host_t *vha = shost_priv(sdev->host); struct req_que *req = vha->req; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (IS_T10_PI_CAPABLE(vha->hw)) blk_queue_update_dma_alignment(sdev->request_queue, 0x7); +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) scsi_adjust_queue_depth(sdev, 0, req->max_q_depth); @@ -3637,6 +3639,11 @@ skip_dpc: QLA_SG_ALL : 128; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + if (IS_T10_PI_CAPABLE(base_vha->hw)) + host->dma_alignment = 0x7; +#endif + ret = scsi_add_host(host, &pdev->dev); if (ret) goto probe_failed; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index a8bf14b..6cd11f7 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1048,12 +1048,14 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ - blk_queue_dma_alignment(q, 4095); + blk_queue_dma_alignment(q, (4096 - 1)); +#endif return 0; } @@ -1379,6 +1381,9 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + .dma_alignment = (4096 - 1), +#endif .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:47:52
|
Commit: 5f4eee5 GitHub URL: https://github.com/SCST-project/scst/commit/5f4eee5fc938a655710c18a9997dc5d780e46673 Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- scst_lib: use bdev_nr_bytes(bdev) instead of i_size_read(bdev->bd_inode) Use the helper to query the size of a block device in bytes. Modified Paths: -------------- scst/include/backport.h | 12 ++++++++++++ scst/src/scst_lib.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index c540277..7967508 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -329,6 +329,18 @@ static inline void bdev_release_backport(struct bdev_handle *handle) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +/* + * See also commit 6436bd90f76e ("block: add a bdev_nr_bytes helper") # v5.16. + */ +static inline loff_t bdev_nr_bytes_backport(struct block_device *bdev) +{ + return i_size_read(bdev->bd_inode); +} + +#define bdev_nr_bytes bdev_nr_bytes_backport +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 8823921..ba776be 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6178,7 +6178,7 @@ loff_t scst_bdev_size(const char *path) if (rc) return rc; - res = i_size_read(bdev_desc.bdev->bd_inode); + res = bdev_nr_bytes(bdev_desc.bdev); scst_release_bdev(&bdev_desc); return res; |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:47:46
|
Commit: ad35eef GitHub URL: https://github.com/SCST-project/scst/commit/ad35eef335594695064d7c1ddcb53274c2690fff Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- scst/include/backport.h: Port to Linux kernel v6.10 Support for the following fs layer changes in the Linux kernel v6.10: - 7c98f7cb8fda ("remove call_{read,write}_iter() functions") Modified Paths: -------------- scst/include/backport.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 97e46c9..c540277 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -553,10 +553,12 @@ typedef unsigned int __poll_t; #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) || \ + LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)) /* * See also commit bb7462b6fd64 ("vfs: use helpers for calling - * f_op->{read,write}_iter()"). + * f_op->{read,write}_iter()") # v4.11. + * See also commit 7c98f7cb8fda ("remove call_{read,write}_iter() functions") # v6.10. */ static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, struct iov_iter *iter) |
From: Gleb C. <lna...@ya...> - 2024-05-17 09:36:27
|
Commit: aa2c925 GitHub URL: https://github.com/SCST-project/scst/commit/aa2c92542998261dea74d0d714a627f3ecad473f Author: Gleb Chesnokov Date: 2024-05-17T12:36:01+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 16 ++++++++------- nightly/conf/nightly.conf | 15 +++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index 60f2580..b63b2ec 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - master + - nightly/update jobs: regression_tests: @@ -13,14 +14,15 @@ jobs: fail-fast: false matrix: version: [ - '6.8.7', + '6.9', + '6.8.9', '6.7.12', - '6.6.28', - '6.1.87', - '5.15.156', - '5.10.215', - '5.4.274', - '4.19.312', + '6.6.30', + '6.1.90', + '5.15.158', + '5.10.216', + '5.4.275', + '4.19.313', '4.14.336', '4.9.337', '3.18.140', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 841cf72..e31dd09 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,37 +3,38 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -6.8.7 \ +6.9 \ +6.8.9-nc \ 6.7.12-nc \ -6.6.28-nc \ +6.6.30-nc \ 6.5.13-nc \ 6.4.16-nc \ 6.3.13-nc \ 6.2.16-nc \ -6.1.87-nc \ +6.1.90-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.156-nc \ +5.15.158-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.215-nc \ +5.10.216-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.274-nc \ +5.4.275-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.312-nc \ +4.19.313-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ |
From: Gleb C. <lna...@ya...> - 2024-05-03 14:45:38
|
Commit: 7c4e074 GitHub URL: https://github.com/SCST-project/scst/commit/7c4e07414afb990e52cc4f6afade215a98ec657a Author: Gleb Chesnokov Date: 2024-05-03T17:45:14+03:00 Log Message: ----------- .github/workflows: Add a GitHub action to run regression tests upon push Introduce a new GitHub action that automatically runs the scripts/run_regression_tests script upon each push to the master branch. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 66 +++++++++++++++ scripts/kernel-functions | 5 ++ scripts/run-regression-tests | 4 +- 3 files changed, 73 insertions(+), 2 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml new file mode 100644 index 0000000..60f2580 --- /dev/null +++ b/.github/workflows/run_regression_tests.yaml @@ -0,0 +1,66 @@ +name: Regression tests upon push + +on: + push: + branches: + - master + +jobs: + regression_tests: + name: ${{matrix.version}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: [ + '6.8.7', + '6.7.12', + '6.6.28', + '6.1.87', + '5.15.156', + '5.10.215', + '5.4.274', + '4.19.312', + '4.14.336', + '4.9.337', + '3.18.140', + '3.10.108', + '5.14.0-284.30.1.el9_2^AlmaLinux^9.2', + '4.18.0-513.24.1.el8_9^AlmaLinux^8.9', + '4.18.0-477.13.1.el8_8^AlmaLinux^8.8', + '3.10.0-1160.108.1.el7^CentOS^7.9.2009', + '5.15.0-205.149.5.1.el9uek^UEK^9', + '5.4.17-2136.330.7.1.el8uek^UEK^8', + '5.4.17-2102.206.1.el7uek^UEK^7', + '4.1.12-124.48.6.el6uek^UEK^6' + ] + steps: + - name: Checkout code + uses: actions/checkout@main + + - name: Install libelf-dev + run: | + sudo apt-get install -y libelf-dev + + - name: Install sparse + run: | + sudo apt-get install sparse + + - name: Install smatch + run: | + git clone https://github.com/error27/smatch.git + cd smatch + make -j + sudo BINDIR=/bin SHAREDIR=/home/runner/share make install + + - name: Run regression tests + run: | + err=0 + + ./scripts/run-regression-tests -l -q -k -d /tmp/scst-${{matrix.version}} ${{matrix.version}}-nc-ns-nm | tee output.txt + + cat output.txt | grep -A1 "Compiling the patched kernel" | grep -e "FAILED" -e "[^0] errors" > /dev/null 2>&1 && err=1 + + rm -f output.txt + + exit $err diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 336baf8..21d904e 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -60,7 +60,9 @@ function download_kernel { [12].*) series="${series:0:3}";; *) series="${series/.*/}.x";; esac + mkdir -p "${kernel_downloads}" || return $? + test -w "${kernel_downloads}" || return $? ( cd "${kernel_downloads}" || return $? @@ -826,6 +828,9 @@ function download_and_extract_distro_rpm { local kver=$1 local distro=$2 local release=$3 + + mkdir -p "${kernel_downloads}" || return $? + ( cd "${kernel_downloads}" || exit $? read -a urls -r <<<"$(get_srpm_urls "$distro" "$release" x86_64 | diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 764e9d7..4d761f1 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -466,9 +466,9 @@ function run_smatch { then local errors warnings errors=$(grep -c ' error:' "${outputfile}") - warnings=$(grep -c ' warning:' "${outputfile}") + warnings=$(grep -c ' warn:' "${outputfile}") echo "${errors} errors / ${warnings} warnings." - grep -E ' info:| warning:| error:' < "${outputfile}" | + grep -E ' info:| warn:| error:' < "${outputfile}" | sed 's/^\([^:]*\):[0-9:]* /\1: /;s/\((see line \)[0-9]*\()\)/\1...\2/' | sort | uniq -c |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:54:23
|
Commit: 3e0408f GitHub URL: https://github.com/SCST-project/scst/commit/3e0408fca6e91e6bc4867c9103c12642c2eaf4b6 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix off by one in qla_edif_app_getstats() The app_reply->elem[] array is allocated earlier in this function and it has app_req.num_ports elements. Thus this > comparison needs to be >= to prevent memory corruption. Fixes: 7878f22a2e03 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") Signed-off-by: Dan Carpenter <dan...@li...> Link: https://lore.kernel.org/r/5c1...@mo...untain Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 4406e4176f47 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_edif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_edif.c b/qla2x00t-32gbit/qla_edif.c index 96b45f6..1ce6c82 100644 --- a/qla2x00t-32gbit/qla_edif.c +++ b/qla2x00t-32gbit/qla_edif.c @@ -1101,7 +1101,7 @@ qla_edif_app_getstats(scsi_qla_host_t *vha, BSG_JOB_TYPE *bsg_job) list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { if (fcport->edif.enable) { - if (pcnt > app_req.num_ports) + if (pcnt >= app_req.num_ports) break; app_reply->elem[pcnt].rekey_count = |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:54:12
|
Commit: 6c6f675 GitHub URL: https://github.com/SCST-project/scst/commit/6c6f6759a6c4d0516231adc7ef965eb63405fb47 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Update version to 10.02.09.200-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 b8260ca37930 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 d903563..7627fd8 100644 --- a/qla2x00t-32gbit/qla_version.h +++ b/qla2x00t-32gbit/qla_version.h @@ -6,9 +6,9 @@ /* * Driver version */ -#define QLA2XXX_VERSION "10.02.09.100-k" +#define QLA2XXX_VERSION "10.02.09.200-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_PATCH_VER 9 -#define QLA_DRIVER_BETA_VER 100 +#define QLA_DRIVER_BETA_VER 200 |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:57
|
Commit: f8f70db GitHub URL: https://github.com/SCST-project/scst/commit/f8f70db99be0698cd2e868caa3777291c54137f0 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Delay I/O Abort on PCI error Currently when PCI error is detected, I/O is aborted manually through the ABORT IOCB mechanism which is not guaranteed to succeed. Instead, wait for the OS or system to notify driver to wind down I/O through the pci_error_handlers api. Set eeh_busy flag to pause all traffic and wait for I/O to drain. 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 591c1fdf2016 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_attr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_attr.c b/qla2x00t-32gbit/qla_attr.c index c35bddd..ed07226 100644 --- a/qla2x00t-32gbit/qla_attr.c +++ b/qla2x00t-32gbit/qla_attr.c @@ -2812,7 +2812,13 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) return; if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { - qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); + /* Will wait for wind down of adapter */ + ql_dbg(ql_dbg_aer, fcport->vha, 0x900c, + "%s pci offline detected (id %06x)\n", __func__, + fcport->d_id.b24); + qla_pci_set_eeh_busy(fcport->vha); + qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, + 0, WAIT_TARGET); return; } } @@ -2834,7 +2840,11 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) vha = fcport->vha; if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { - qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); + /* Will wait for wind down of adapter */ + ql_dbg(ql_dbg_aer, fcport->vha, 0x900b, + "%s pci offline detected (id %06x)\n", __func__, + fcport->d_id.b24); + qla_pci_set_eeh_busy(vha); qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, 0, WAIT_TARGET); return; |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:37
|
Commit: b7481e8 GitHub URL: https://github.com/SCST-project/scst/commit/b7481e82ef5b97c7418839338a1d210b577d212b Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Change debug message during driver unload Upon driver unload, purge_mbox flag is set and the heartbeat monitor thread detects this flag and does not send the mailbox command down to FW with a debug message "Error detected: purge[1] eeh[0] cmd=0x0, Exiting". This being not a real error, change the debug message. Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@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 b5a30840727a upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_mbx.c b/qla2x00t-32gbit/qla_mbx.c index 21ec32b..0cd6f3e 100644 --- a/qla2x00t-32gbit/qla_mbx.c +++ b/qla2x00t-32gbit/qla_mbx.c @@ -194,7 +194,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) if (ha->flags.purge_mbox || chip_reset != ha->chip_reset || ha->flags.eeh_busy) { ql_log(ql_log_warn, vha, 0xd035, - "Error detected: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", + "Purge mbox: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0]); rval = QLA_ABORTED; goto premature_exit; |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:23
|
Commit: f9329cc GitHub URL: https://github.com/SCST-project/scst/commit/f9329cc7e65423b6ffcc5b06629aaa057c7d3468 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix double free of fcport The server was crashing after LOGO because fcport was getting freed twice. -----------[ cut here ]----------- kernel BUG at mm/slub.c:371! invalid opcode: 0000 1 SMP PTI CPU: 35 PID: 4610 Comm: bash Kdump: loaded Tainted: G OE --------- - - 4.18.0-425.3.1.el8.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 RIP: 0010:set_freepointer.part.57+0x0/0x10 RSP: 0018:ffffb07107027d90 EFLAGS: 00010246 RAX: ffff9cb7e3150000 RBX: ffff9cb7e332b9c0 RCX: ffff9cb7e3150400 RDX: 0000000000001f37 RSI: 0000000000000000 RDI: ffff9cb7c0005500 RBP: fffff693448c5400 R08: 0000000080000000 R09: 0000000000000009 R10: 0000000000000000 R11: 0000000000132af0 R12: ffff9cb7c0005500 R13: ffff9cb7e3150000 R14: ffffffffc06990e0 R15: ffff9cb7ea85ea58 FS: 00007ff6b79c2740(0000) GS:ffff9cb8f7ec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055b426b7d700 CR3: 0000000169c18002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: kfree+0x238/0x250 qla2x00_els_dcmd_sp_free+0x20/0x230 [qla2xxx] ? qla24xx_els_dcmd_iocb+0x607/0x690 [qla2xxx] qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? kernfs_fop_write+0x11e/0x1a0 Remove one of the free calls and add check for valid fcport. Also use function qla2x00_free_fcport() instead of kfree(). Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@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 82f522ae0d97 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_iocb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index a67123b..85c3b9a 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -2653,7 +2653,8 @@ static void qla2x00_els_dcmd_sp_free(srb_t *sp) { struct srb_iocb *elsio = &sp->u.iocb_cmd; - kfree(sp->fcport); + if (sp->fcport) + qla2x00_free_fcport(sp->fcport); if (elsio->u.els_logo.els_logo_pyld) dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, @@ -2766,6 +2767,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, if (!elsio->u.els_logo.els_logo_pyld) { /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); + qla2x00_free_fcport(fcport); return QLA_FUNCTION_FAILED; } @@ -2800,7 +2802,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, fcport->d_id.b.area, fcport->d_id.b.al_pa); wait_for_completion(&elsio->u.els_logo.comp); - qla2x00_free_fcport(fcport); /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:09
|
Commit: b0dd719 GitHub URL: https://github.com/SCST-project/scst/commit/b0dd719ad27a4361b743de940ef599250b050f1d Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix double free of the ha->vp_map pointer Coverity scan reported potential risk of double free of the pointer ha->vp_map. ha->vp_map was freed in qla2x00_mem_alloc(), and again freed in function qla2x00_mem_free(ha). Assign NULL to vp_map and kfree take care of NULL. Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@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 e288285d4778 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 1 + 1 file changed, 1 insertion(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index fdc91e7..20742d2 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -4673,6 +4673,7 @@ fail_free_init_cb: ha->init_cb_dma = 0; fail_free_vp_map: kfree(ha->vp_map); + ha->vp_map = NULL; fail: ql_log(ql_log_fatal, NULL, 0x0030, "Memory allocation failure.\n"); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:02
|
Commit: 5a325ea GitHub URL: https://github.com/SCST-project/scst/commit/5a325ea4a7be5426faa5c8dbafef02b1e3a5269a Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix command flush on cable pull System crash due to command failed to flush back to SCSI layer. BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 27 PID: 793455 Comm: kworker/u130:6 Kdump: loaded Tainted: G OE --------- - - 4.18.0-372.9.1.el8.x86_64 #1 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 Code: 24 10 4d 85 c9 74 0a 41 f6 01 04 0f 85 9d 00 00 00 48 8b 43 08 48 83 c3 08 4c 8d 48 e8 49 8d 41 18 48 39 c3 0f 84 f0 00 00 00 <49> 8b 41 18 89 54 24 08 31 ed 4c 8d 70 e8 45 8b 29 41 f6 c5 04 75 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] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae1407ca000 from port 21:32:00:02:ac:07:ee:b8 loop_id 0x02 s_id 01:02:00 logout 1 keep 0 els_logo 0 ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:00:02:ac:07:ee:b8 state transitioned from ONLINE to LOST - portid=010200. ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320002ac07eeb8. rport ffff8ae598122000 roles 1 ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae14801e000 from port 21:32:01:02:ad:f7:ee:b8 loop_id 0x04 s_id 01:02:01 logout 1 keep 0 els_logo 0 ? __switch_to+0x10c/0x450 ? process_one_work+0x1a7/0x360 qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:01:02:ad:f7:ee:b8 state transitioned from ONLINE to LOST - portid=010201. ? worker_thread+0x1ce/0x390 ? create_worker+0x1a0/0x1a0 qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320102adf7eeb8. rport ffff8ae3b2312800 roles 70 ? kthread+0x10a/0x120 qla2xxx [0000:12:00.1]-2112:3: qla_nvme_unregister_remote_port: unregister remoteport on ffff8ae14801e000 21320102adf7eeb8 ? set_kthread_struct+0x40/0x40 qla2xxx [0000:12:00.1]-2110:3: remoteport_delete of ffff8ae14801e000 21320102adf7eeb8 completed. ? ret_from_fork+0x1f/0x40 qla2xxx [0000:12:00.1]-f086:3: qlt_free_session_done: waiting for sess ffff8ae14801e000 logout The system was under memory stress where driver was not able to allocate an SRB to carry out error recovery of cable pull. The failure to flush causes upper layer to start modifying scsi_cmnd. When the system frees up some memory, the subsequent cable pull trigger another command flush. At this point the driver access a null pointer when attempting to DMA unmap the SGL. Add a check to make sure commands are flush back on session tear down to prevent the null pointer access. 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 a27d4d0e7de3 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_target.c | 10 ++++++++++ 1 file changed, 10 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 6ef76bd..48c4f86 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -1077,6 +1077,16 @@ void qlt_free_session_done(struct work_struct *work) "%s: sess %p logout completed\n", __func__, sess); } + /* check for any straggling io left behind */ + if (!(sess->flags & FCF_FCP2_DEVICE) && + qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) { + ql_log(ql_log_warn, vha, 0x3027, + "IO not return. Resetting.\n"); + set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + qla2x00_wait_for_chip_reset(vha); + } + if (sess->logo_ack_needed) { sess->logo_ack_needed = 0; qla24xx_async_notify_ack(vha, sess, |