Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-22 Thread zhengbin (A)
On 2019/10/22 9:59, zhengbin (A) wrote: > On 2019/10/21 21:06, Hannes Reinecke wrote: >> On 10/21/19 3:49 AM, zhengbin (A) wrote: >>> On 2019/10/18 21:43, Martin K. Petersen wrote: >>>> Hannes, >>>> >>>>> The one thing which I patently don

Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-21 Thread zhengbin (A)
On 2019/10/21 21:06, Hannes Reinecke wrote: > On 10/21/19 3:49 AM, zhengbin (A) wrote: >> On 2019/10/18 21:43, Martin K. Petersen wrote: >>> Hannes, >>> >>>> The one thing which I patently don't like is the ambivalence between >>>> DRIVER

Re: [PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-20 Thread zhengbin (A)
if >> DRIVER_SENSE is not set, but we have a valid sense code? Or the other >> way around? > I agree, it's a mess. > > (Sorry, zhengbin, you opened a can of worms. This is some of our oldest > and most arcane code in SCSI) > >> But more important, from a quic

[PATCH] scsi: sd: fix uninit access of sshdr

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute and whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/sd.c | 57 ++- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/drivers/scsi

[PATCH v5 03/13] scsi: core: need to check the result of scsi_execute in scsi_report_lun_scan

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/scsi_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 058079f..781f82a 100644 --- a

[PATCH v5 06/13] scsi: scsi_dh_emc: need to check the result of scsi_execute in send_trespass_cmd

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/device_handler/scsi_dh_emc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler

[PATCH v5 02/13] scsi: core: need to check the result of scsi_execute in scsi_test_unit_ready

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5447738..2970190 100644 --- a/drivers/scsi

[PATCH v5 05/13] scsi: sr: need to check the result of scsi_execute in sr_do_ioctl

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute, also need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/sr_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index

[PATCH v5 01/13] scsi: core: need to check the result of scsi_execute in scsi_report_opcode

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 4f76841..15d1fe9 100644 --- a/drivers/scsi

[PATCH v5 07/13] scsi: scsi_dh_rdac: need to check the result of scsi_execute in send_mode_select

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/device_handler/scsi_dh_rdac.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi

[PATCH v5 11/13] scsi: cxlflash: need to check whether sshdr is valid in read_cap16

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/cxlflash/superpipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index 593669a

[PATCH v5 00/13] scsi: core: fix uninit-value access of variable sshdr

2019-10-18 Thread zhengbin
v1->v2: modify the comments suggested by Bart v2->v3: fix bug in sr_do_ioctl v3->v4: let "fix bug in sr_do_ioctl" be a separate patch v4->v5: fix uninit-value access bug in callers, not in __scsi_execute zhengbin (13): scsi: core: need to check the res

[PATCH v5 12/13] scsi: ufs: need to check whether sshdr is valid in ufshcd_set_dev_pwr_mode

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c28c144..5afc426 100644 --- a

[PATCH v5 08/13] scsi: scsi_dh_hp_sw: need to check the result of scsi_execute in hp_sw_tur,hp_sw_start_stop

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi

[PATCH v5 09/13] scsi: scsi_dh_alua: need to check the result of scsi_execute in alua_rtpg,alua_stpg

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. submit_rtpg/submit_stpg scsi_execute Signed-off-by: zhengbin --- drivers/scsi/device_handler/scsi_dh_alua.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/device_handler

[PATCH v5 13/13] scsi: ch: need to check whether sshdr is valid in ch_do_scsi

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/ch.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 76751d6..dba6fe2 100644 --- a/drivers/scsi/ch.c

[PATCH v5 04/13] scsi: sr: need to check the result of scsi_execute in sr_get_events

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/sr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 4664fdf..5c5476b 100644 --- a/drivers/scsi/sr.c

[PATCH v5 10/13] scsi: scsi_transport_spi: need to check whether sshdr is valid in spi_execute

2019-10-18 Thread zhengbin
Like sd_pr_command, before use sshdr, we need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/scsi_transport_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index f866106..428f9b8 100644

Re: [PATCH v4 2/2] scsi: core: fix uninit-value access of variable sshdr

2019-10-17 Thread zhengbin (A)
On 2019/10/18 10:40, Martin K. Petersen wrote: > zhengbin, > >> We can init sshdr in sr_get_events, but there have many callers of >> scsi_execute, scsi_execute_req, we have to troubleshoot all callers, >> the simpler way is init sshdr in __scsi_execute. > There ar

[PATCH v4 0/2] scsi: core: fix uninit-value access of variable sshdr

2019-10-16 Thread zhengbin
v1->v2: modify the comments suggested by Bart v2->v3: fix bug in sr_do_ioctl v3->v4: let "fix bug in sr_do_ioctl" be a separate patch zhengbin (2): sr: need to check whether sshdr is valid in sr_do_ioctl scsi: core: fix uninit-value access of variable sshdr drivers/

[PATCH v4 1/2] sr: need to check whether sshdr is valid in sr_do_ioctl

2019-10-16 Thread zhengbin
Like other callers of scsi_execute(send_trespass_cmd, hp_sw_tur...), we need to check whether sshdr is valid. Signed-off-by: zhengbin --- drivers/scsi/sr_ioctl.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index ffcf902..335cfdd

[PATCH v4 2/2] scsi: core: fix uninit-value access of variable sshdr

2019-10-16 Thread zhengbin
t_events, but there have many callers of scsi_execute, scsi_execute_req, we have to troubleshoot all callers, the simpler way is init sshdr in __scsi_execute. Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b

Re: [PATCH v3] scsi: core: fix uninit-value access of variable sshdr

2019-10-16 Thread zhengbin (A)
On 2019/10/17 10:45, Bart Van Assche wrote: > On 2019-10-11 20:25, zhengbin wrote: >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index 5447738..d5e29c5 100644 >> --- a/drivers/scsi/scsi_lib.c >> +++ b/drivers/scsi/scsi_lib.c >> @@ -25

Re: [PATCH v3] scsi: core: fix uninit-value access of variable sshdr

2019-10-16 Thread zhengbin (A)
On 2019/10/17 8:05, Finn Thain wrote: > On Sat, 12 Oct 2019, zhengbin wrote: > >> kmsan report a warning in 5.1-rc4: >> >> BUG: KMSAN: uninit-value in sr_get_events drivers/scsi/sr.c:207 [inline] >> BUG: KMSAN: uninit-value in sr_check_events+0x2cf/0x1090 >>

[PATCH v3] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread zhengbin
t_events, but there have many callers of scsi_execute, scsi_execute_req, we have to troubleshoot all callers, the simpler way is init sshdr in __scsi_execute. BTW: sr_do_ioctl should check whether sshdr is valid, fix this Signed-off-by: zhengbin --- v1->v2: modify the comments suggested by Bart

Re: [PATCH v2] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread zhengbin (A)
On 2019/10/12 10:06, James Bottomley wrote: > On Sat, 2019-10-12 at 10:03 +0800, zhengbin (A) wrote: >> On 2019/10/12 9:58, James Bottomley wrote: >>> On Sat, 2019-10-12 at 09:26 +0800, zhengbin wrote: >>>> BTW: we can't just init sshdr->response_code,

Re: [PATCH v2] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread zhengbin (A)
On 2019/10/12 9:58, James Bottomley wrote: > On Sat, 2019-10-12 at 09:26 +0800, zhengbin wrote: >> BTW: we can't just init sshdr->response_code, sr_do_ioctl use >> sshdr->sense_key > That's an actual bug, isn't it? If we init sshdr in __scsi_execute, this will be ok > > James > > > . >

[PATCH v2] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread zhengbin
t_events, but there have many callers of scsi_execute, scsi_execute_req, we have to troubleshoot all callers, the simpler way is init sshdr in __scsi_execute. BTW: we can't just init sshdr->response_code, sr_do_ioctl use sshdr->sense_key Signed-off-by: zhengbin --- v1->v2: modify the

Re: [PATCH] scsi: core: fix uninit-value access of variable sshdr

2019-10-10 Thread zhengbin (A)
On 2019/10/11 1:03, Bart Van Assche wrote: > On 10/10/19 5:05 AM, zhengbin wrote: >> kmsan report a warning in 5.1-rc4: >> >> BUG: KMSAN: uninit-value in sr_get_events drivers/scsi/sr.c:207 [inline] >> BUG: KMSAN: uninit-value in sr_check_events+0x2cf/0x1090 >>

[PATCH] scsi: core: fix uninit-value access of variable sshdr

2019-10-10 Thread zhengbin
t_events, but there have many callers of scsi_execute, scsi_execute_req, we have to troubleshoot all callers, the simpler way is init sshdr in __scsi_execute. BTW: we can't just init sshdr->response_code, sr_do_ioctl use sshdr->sense_key(Need to troubleshoot all callers) Signed-off-by: zhe

[PATCH] scsi: megaraid: remove set but not used variables 'debugBlk','fusion'

2019-10-09 Thread zhengbin
ll gen controllers") Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/megaraid/megaraid_sas_fp.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 5

[PATCH] scsi: lpfc: Make function lpfc_defer_pt2pt_acc static

2019-10-04 Thread zhengbin
Fix sparse warnings: drivers/scsi/lpfc/lpfc_nportdisc.c:290:1: warning: symbol 'lpfc_defer_pt2pt_acc' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH] scsi: fcoe: fix null-ptr-deref Read in fc_release_transport

2019-09-04 Thread zhengbin (A)
ping On 2019/8/20 13:43, zhengbin wrote: > In fcoe_if_init, if fc_attach_transport(&fcoe_vport_fc_functions) > fails, need to free the previously memory and return fail, > otherwise will trigger null-ptr-deref Read in fc_release_transport. > > fcoe_exit > fcoe_if_exit >

[PATCH v2] scsi: ufs: remove set but not used variable 'val'

2019-08-25 Thread zhengbin
calls from host") Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/ufs/ufs-qcom.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 4473f33..02cdcef 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers

[PATCH] scsi: ufs: remove set but not used variable 'val'

2019-08-23 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/ufs/ufs-qcom.c: In function ufs_qcom_pwr_change_notify: drivers/scsi/ufs/ufs-qcom.c:808:6: warning: variable val set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/sc

[PATCH 0/2] scsi: csiostor: remove some set but not used variables

2019-08-23 Thread zhengbin
zhengbin (2): scsi: csiostor: remove set but not used variables 'mc_bist_status_rdata_reg','edc_bist_status_rdata_reg' scsi: csiostor: remove set but not used variable 'rln' drivers/scsi/csiostor/csio_hw_t5.c | 6 ++ drivers/scsi/csiostor/csio_lnode

[PATCH 1/2] scsi: csiostor: remove set but not used variables 'mc_bist_status_rdata_reg','edc_bist_status_rdata_reg'

2019-08-23 Thread zhengbin
n function csio_t5_edc_read: drivers/scsi/csiostor/csio_hw_t5.c:199:38: warning: variable edc_bist_status_rdata_reg set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/csiostor/csio_hw_t5.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH 2/2] scsi: csiostor: remove set but not used variable 'rln'

2019-08-23 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/csiostor/csio_lnode.c: In function csio_ln_init: drivers/scsi/csiostor/csio_lnode.c:1992:21: warning: variable rln set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- dr

[PATCH 2/3] scsi: bnx2fc: remove set but not used variables 'lport','host'

2019-08-23 Thread zhengbin
t-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/bnx2fc/bnx2fc_io.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 9e50e5b..da00ca5 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/dr

[PATCH 1/3] scsi: bnx2fc: remove set but not used variable 'fh'

2019-08-23 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/bnx2fc/bnx2fc_fcoe.c: In function bnx2fc_rcv: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:431:26: warning: variable fh set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/s

[PATCH 3/3] scsi: bnx2fc: remove set but not used variables 'task','port','orig_task'

2019-08-23 Thread zhengbin
ed-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 747f019..f069e09 100644 --- a/drivers/s

[PATCH 0/3] scsi: bnx2fc: remove some set but not used variables

2019-08-23 Thread zhengbin
zhengbin (3): scsi: bnx2fc: remove set but not used variable 'fh' scsi: bnx2fc: remove set but not used variables 'lport','host' scsi: bnx2fc: remove set but not used variables 'task','port','orig_task' drivers/scsi/bnx2fc/b

[PATCH] scsi: isci: remove set but not used variable 'index'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/isci/host.c: In function sci_controller_complete_io: drivers/scsi/isci/host.c:2674:6: warning: variable index set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/i

[PATCH] scsi: arcmsr: remove set but not used variable 'flags'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/arcmsr/arcmsr_hba.c: In function arcmsr_remap_pciregion: drivers/scsi/arcmsr/arcmsr_hba.c:286:30: warning: variable flags set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- dr

[PATCH] scsi: hisi_sas: remove set but not used variable 'irq_value'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/hisi_sas/hisi_sas_v1_hw.c: In function cq_interrupt_v1_hw: drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1542:6: warning: variable irq_value set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by

[PATCH 4/4] scsi: bfa: remove set but not used variable 'pgoff'

2019-08-22 Thread zhengbin
t-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/bfa/bfa_ioc.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 93471d7..52d1624 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++

[PATCH 2/4] scsi: bfa: remove set but not used variable 'rp'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/bfa/bfa_fcpim.c: In function bfa_fcpim_lunmask_delete: drivers/scsi/bfa/bfa_fcpim.c:2346:22: warning: variable rp set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- driver

[PATCH 3/4] scsi: bfa: remove set but not used variable 'adisc'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/bfa/bfa_fcs_rport.c: In function bfa_fcs_rport_process_adisc: drivers/scsi/bfa/bfa_fcs_rport.c:2251:21: warning: variable adisc set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --

[PATCH 0/4] scsi: bfa: remove some set but not used variables

2019-08-22 Thread zhengbin
zhengbin (4): scsi: bfa: remove set but not used variable 'fchs' scsi: bfa: remove set but not used variable 'rp' scsi: bfa: remove set but not used variable 'adisc' scsi: bfa: remove set but not used variable 'pgoff' drivers/scsi/bfa/bf

[PATCH 1/4] scsi: bfa: remove set but not used variable 'fchs'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/bfa/bfa_svc.c: In function uf_recv: drivers/scsi/bfa/bfa_svc.c:5528:17: warning: variable fchs set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/bfa/bfa_svc.c

[PATCH 2/3] scsi: aic7xxx: remove set but not used variables 'ahc','targ'

2019-08-22 Thread zhengbin
send_async: drivers/scsi/aic7xxx/aic7xxx_osm.c:1611:28: warning: variable targ set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7xx

[PATCH 1/3] scsi: aic7xxx: remove set but not used variables 'ahd','paused','wait','saved_scsiid'

2019-08-22 Thread zhengbin
t-variable] drivers/scsi/aic7xxx/aic79xx_osm.c: In function ahd_linux_queue_abort_cmd: drivers/scsi/aic7xxx/aic79xx_osm.c:2155:9: warning: variable saved_scsiid set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/aic7xxx/aic79xx_osm.c | 9 --

[PATCH 3/3] scsi: aic7xxx: remove set but not used variables 'tinfo','lqistat2'

2019-08-22 Thread zhengbin
ed-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/aic7xxx/aic79xx_core.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 7e5044b..75d94d6 10

[PATCH 0/3] scsi: aic7xxx: remove some set but not used variables

2019-08-22 Thread zhengbin
zhengbin (3): scsi: aic7xxx: remove set but not used variables 'ahd','paused','wait','saved_scsiid' scsi: aic7xxx: remove set but not used variables 'ahc','targ' scsi: aic7xxx: remove set but not used variables &

[PATCH 1/3] scsi: qla4xxx: remove set but not used variables 'data_size','poll','mask'

2019-08-22 Thread zhengbin
unused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/qla4xxx/ql4_nx.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 5a31877..85666fb 100644 --- a/drivers/sc

[PATCH 2/3] scsi: qla4xxx: remove set but not used variable 'func_number'

2019-08-22 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/qla4xxx/ql4_init.c: In function ql4xxx_set_mac_number: drivers/scsi/qla4xxx/ql4_init.c:17:10: warning: variable func_number set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --

[PATCH 0/3] scsi: qla4xxx: remove some set but not used variables

2019-08-22 Thread zhengbin
zhengbin (3): scsi: qla4xxx: remove set but not used variables 'data_size','poll','mask' scsi: qla4xxx: remove set but not used variable 'func_number' scsi: qla4xxx: remove set but not used variables 'sess','dst_addr',&#

[PATCH 3/3] scsi: qla4xxx: remove set but not used variables 'sess','dst_addr','db_base','db_len','ha'

2019-08-22 Thread zhengbin
ha set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/qla4xxx/ql4_os.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 8c674ec..49c87b0 10

[PATCH 2/2] scsi: megaraid: remove set but not used variables 'debugBlk','fusion'

2019-08-22 Thread zhengbin
t not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/scsi/megaraid/megaraid_sas_fp.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c ind

[PATCH 0/2] scsi: megaraid: remove some set but not used variables

2019-08-22 Thread zhengbin
zhengbin (2): scsi: megaraid: remove set but not used variable 'reg_set' scsi: megaraid: remove set but not used variables 'debugBlk','fusion' drivers/scsi/megaraid/megaraid_sas_fp.c | 7 +-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 --- 2 fi

[PATCH 1/2] scsi: megaraid: remove set but not used variable 'reg_set'

2019-08-22 Thread zhengbin
ot Signed-off-by: zhengbin --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 120e3c4..fdf6559 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusi

[PATCH] scsi: fcoe: fix null-ptr-deref Read in fc_release_transport

2019-08-19 Thread zhengbin
obot Signed-off-by: zhengbin --- drivers/scsi/fcoe/fcoe.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 00dd47b..2f82e56 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -125

Re: [PATCH 4.19-stable] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-19 Thread zhengbin (A)
On 2019/8/19 12:08, Ming Lei wrote: > On Mon, Aug 19, 2019 at 10:39:05AM +0800, zhengbin wrote: >> KASAN reports a use-after-free in 4.19-stable, >> which won't happen after commit 47cdee29ef9d >> ("block: move blk_exit_queue into __blk_release_queue"). >

[PATCH 4.19-stable] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-18 Thread zhengbin
ead+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 24 ++-- drivers/scsi/scsi_sysfs.c | 3 ++- 2 files changed, 20 insertions(+), 7

Re: [PATCH v4] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-18 Thread zhengbin (A)
On 2019/8/17 1:09, Bart Van Assche wrote: > On 8/12/19 8:35 PM, zhengbin wrote: >> KASAN reports a use-after-free in 4.19-stable, >> which won't happen after commit 47cdee29ef9d >> ("block: move blk_exit_queue into __blk_release_queue"). > > This pat

Re: [PATCH v4] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-15 Thread zhengbin (A)
On 2019/8/15 23:40, Bart Van Assche wrote: > On 8/14/19 6:50 PM, zhengbin (A) wrote: >> ping > > Sending a "ping" after 46 hours is way too soon and only causes irritation. > What would help though is more information about how this patch has been > tested. Does i

[PATCH v4] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-12 Thread zhengbin
read+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 15 +++ drivers/scsi/scsi_sysfs.c | 3 ++- 2 files changed, 13 insertions

[PATCH v3] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-11 Thread zhengbin
read+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/

[PATCH v2] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-11 Thread zhengbin
read+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/

[PATCH] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-09 Thread zhengbin
read+0x6c/0x6a8 kthread+0x1b4/0x1c0 ret_from_fork+0x10/0x18 Fixes: 8dc765d438f1 ("SCSI: fix queue cleanup race before queue initialization is done") Signed-off-by: zhengbin --- drivers/scsi/scsi_lib.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/

Re: [PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-30 Thread zhengbin (A)
ping On 2019/3/26 21:29, zhengbin (A) wrote: > On 2019/3/25 19:55, zhengbin (A) wrote: >> On 2019/3/25 18:02, Pavel Tikhomirov wrote: >>> Likely we should do the same for host_eh_scheduled++ as we do for >>> host_failed++ in scsi_eh_inc_host_failed. Just put it

Re: [PATCH v5] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-26 Thread zhengbin (A)
ping On 2019/3/22 11:01, Ming Lei wrote: > On Fri, Mar 22, 2019 at 10:56:46AM +0800, zhengbin wrote: >> When I use dd test a SCSI device which use blk-mq in the following steps: >> 1.echo "blocked" >/sys/block/sda/device/state >> 2.dd if=/dev/sda of=/mnt/t.log

Re: [PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-26 Thread zhengbin (A)
On 2019/3/25 19:55, zhengbin (A) wrote: > On 2019/3/25 18:02, Pavel Tikhomirov wrote: >> Likely we should do the same for host_eh_scheduled++ as we do for >> host_failed++ in scsi_eh_inc_host_failed. Just put it in call_rcu. These >> way rcu_read_lock would be enough: if

Re: [PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-25 Thread zhengbin (A)
On 2019/3/25 20:20, John Garry wrote: > On 25/03/2019 11:55, zhengbin (A) wrote: >> On 2019/3/25 18:02, Pavel Tikhomirov wrote: >>> Likely we should do the same for host_eh_scheduled++ as we do for >>> host_failed++ in scsi_eh_inc_host_failed. Just put it in call_rcu.

Re: [PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-25 Thread zhengbin (A)
d rcu_head in Scsi_Host, replace scsi_schedule_eh(ap->scsi_host) with call_rcu in ata_std_sched_eh, sas_queue_reset?? This will trigger a kernel hang or oops because of double or more call_rcu() call. Any more suggestions? > > On 3/25/19 12:05 PM, zhengbin wrote: >> When I use f

[PATCH] scsi: fix ata_port_wait_eh() hung caused by missing to wake up eh thread

2019-03-25 Thread zhengbin
shost_state(!=recovery) scsi_host_set_state(SHOST_RECOVERY) scsi_eh_wakeup(host_busy != host_failed) atomic_dec(&shost->host_busy); if (scsi_host_in_recovery(shost)) Add a smp_mb between host_busy and shost_state. Signed-off-by: zhengbin ---

Some questions about scsi_eh_wakeup

2019-03-23 Thread zhengbin (A)
lock_irqrestore(shost->host_lock, flags); } rcu_read_unlock(); PS: commit 3bd6f43f5(use rcu_read_lock) fix the hung issue if scsi_eh_scmd_add() is called concurrently with scsi_host_queue_ready() while shost->host_blocked > 0 Thanks, zhengbin

[PATCH v5] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-21 Thread zhengbin
e when the resource is available. Need to follow the rule if we set the device state to running. Signed-off-by: zhengbin --- drivers/scsi/scsi_sysfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 6a9040f..67c214a 100644 --- a

Re: [PATCH v4] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-21 Thread zhengbin (A)
So blk_mq_run_hw_queues should still be in mutex_lock(&sdev->state_mutex)?? On 2019/3/22 10:11, Ming Lei wrote: > On Fri, Mar 22, 2019 at 09:45:54AM +0800, zhengbin wrote: >> When I use dd test a SCSI device which use blk-mq in the following steps: >> 1.echo "blocked&qu

[PATCH v4] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-21 Thread zhengbin
e when the resource is available. Need to follow the rule if we set the device state to running. Signed-off-by: zhengbin --- drivers/scsi/scsi_sysfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 6a9040f..266e4c7 100644 --- a

[PATCH v3] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-20 Thread zhengbin
e when the resource is available. Need to follow the rule if we set the device state to running. Signed-off-by: zhengbin --- drivers/scsi/scsi_sysfs.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 6a9040f..3

[PATCH v2] blk-mq: fix a hung issue when set device state to blocked and restore running

2019-03-20 Thread zhengbin
e when the resource is available. Need to follow the rule if we set the device state to running. Signed-off-by: zhengbin --- drivers/scsi/scsi_sysfs.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 6a9040f..c