Re: [PATCHv2 2/2] scsi: ibmvscsis: Ensure partition name is properly NUL terminated

2018-09-17 Thread Bryant Ly
> On Sep 11, 2018, at 2:22 PM, Laura Abbott wrote: > > While reviewing another part of the code, Kees noticed that the > strncpy of the partition name might not always be NUL terminated. Switch > to using strscpy which does this safely. > > Reported-by: Kees Cook > Signed-off-by: Laura Abbot

Re: [PATCH V3 11/17] SCSI: track pending admin commands

2018-09-17 Thread jianchao.wang
Hi Ming On 09/17/2018 07:35 PM, Ming Lei wrote: > On Mon, Sep 17, 2018 at 10:46:34AM +0800, jianchao.wang wrote: >> Hi Ming >> >> On 09/14/2018 07:33 PM, Ming Lei wrote: >>> On Fri, Sep 14, 2018 at 11:40 AM jianchao.wang >>> wrote: Hi Ming On 09/13/2018 08:15 PM, Ming Lei wrot

Re: [PATCHv3 1/2] scsi: ibmvscsis: Fix a stringop-overflow warning

2018-09-17 Thread Ly, Bryant
> On Sep 11, 2018, at 2:22 PM, Laura Abbott wrote: > > There's currently a warning about string overflow with strncat: > > drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_probe': > drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3479:2: error: 'strncat' specified > bound 64 equals d

Re: [PATCH 2/6] qla2xxx_nvmet: Added Makefile and Kconfig changes

2018-09-17 Thread Madhani, Himanshu
> On Sep 17, 2018, at 1:03 PM, Bart Van Assche wrote: > > External Email > > On 9/17/18 12:07 PM, Madhani, Himanshu wrote: >> >>> On Sep 15, 2018, at 9:53 PM, Bart Van Assche wrote: >>> >>> External Email >>> >>> On 09/14/18 14:28, Himanshu Madhani wrote: diff --git a/drivers/scsi/qla2

Re: [PATCH 2/6] qla2xxx_nvmet: Added Makefile and Kconfig changes

2018-09-17 Thread Bart Van Assche
On 9/17/18 12:07 PM, Madhani, Himanshu wrote: On Sep 15, 2018, at 9:53 PM, Bart Van Assche wrote: External Email On 09/14/18 14:28, Himanshu Madhani wrote: diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig index 036cc3f217b1..f1539d8b68ef 100644 --- a/drivers/scsi/qla

Re: [PATCH 3/6] qla2xxx_nvmet: Add FC-NVMe Target LS request handling

2018-09-17 Thread Madhani, Himanshu
> On Sep 16, 2018, at 6:42 AM, Bart Van Assche wrote: > > External Email > > On 09/14/18 14:28, Himanshu Madhani wrote: >> From: Anil Gurumurthy >> >> This patch adds LS handling into driver > > Please make the patch description more clear. What does "LS" stand for? > What is the relationshi

Re: [PATCH 2/6] qla2xxx_nvmet: Added Makefile and Kconfig changes

2018-09-17 Thread Madhani, Himanshu
> On Sep 15, 2018, at 9:53 PM, Bart Van Assche wrote: > > External Email > > On 09/14/18 14:28, Himanshu Madhani wrote: >> diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig >> index 036cc3f217b1..f1539d8b68ef 100644 >> --- a/drivers/scsi/qla2xxx/Kconfig >> +++ b/drivers/s

Re: [PATCH 1/6] qla2xxx_nvmet: Add files for FC-NVMe Target support

2018-09-17 Thread Madhani, Himanshu
Hi Bart, > On Sep 15, 2018, at 9:50 PM, Bart Van Assche wrote: > > External Email > > On 09/14/18 14:28, Himanshu Madhani wrote: >> diff --git a/drivers/scsi/qla2xxx/qla_nvmet.c >> b/drivers/scsi/qla2xxx/qla_nvmet.c >> new file mode 100644 >> [ ... ] >> +#if IS_ENABLED(CONFIG_NVME_TARGET_FC)

Re: [PATCH] scsi: mptfusion: Remove unnecessary parentheses and simplify null checks

2018-09-17 Thread Nick Desaulniers
On Fri, Sep 14, 2018 at 11:36 PM Nathan Chancellor wrote: > > Clang warns when multiple pairs of parentheses are used for a single > conditional statement. > > drivers/message/fusion/mptbase.c:338:11: warning: equality comparison > with extraneous parentheses [-Wparentheses-equality] > if

[PATCH v5 6/6] scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()

2018-09-17 Thread Avri Altman
Add support to those uic commands, that are currently supported by ufshcd api: the variants of dme_{peer}_{set_get}. At this point better not to add any new api, as careless uic command may turn the device into a brick. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 54

[PATCH v5 5/6] scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request()

2018-09-17 Thread Avri Altman
Do that for the currently supported UPIUs: query, nop out, and task management. We do not support UPIU of type scsi command yet, while we are using the job's request and reply pointers to hold the payload. We will look into it in later patches. We might need to elaborate the raw upiu api for that

[PATCH v5 4/6] scsi: ufs: Add API to execute raw upiu commands

2018-09-17 Thread Avri Altman
The UFS host software uses a combination of a host register set, and Transfer Request Descriptors in system memory to communicate with host controller hardware. In its mmio space, a separate places are assigned to UTP Transfer Request Descriptor ("utrd") list, and to UTP Task Management Request Des

[PATCH v5 3/6] scsi: ufs: Add ufs-bsg module

2018-09-17 Thread Avri Altman
Add a bsg endpoint that supports UPIUs. For now, just provide an API to allocate and remove ufs-bsg node. We will use this framework to manage ufs devices by sending UPIU transactions. For the time being, implements an empty bsg_request() - will add some more functionality in coming patches. Non

[PATCH v5 2/6] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-09-17 Thread Avri Altman
From: Christoph Hellwig Add a helper that takes a utp_task_req_desc and issues it, which will be useful for UFS bsg support. Rewrite ufshcd_issue_tm_cmd0x to use this new helper. Signed-off-by: Christoph Hellwig --- drivers/scsi/ufs/ufshcd.c | 141 -

[PATCH v5 1/6] scsi: ufs: cleanup struct utp_task_req_desc

2018-09-17 Thread Avri Altman
From: Christoph Hellwig Remove the pointless task_req_upiu and task_rsp_upiu indirections, which are __le32 arrays always cast to given structures and just add the members directly. Also clean up variables names in use in the callers a bit to make the code more readable. Signed-off-by: Christop

[PATCH v5 0/6] scsi: Add ufs bsg endpoint

2018-09-17 Thread Avri Altman
Here is a proposal to use a bsg endpoint to manage ufs devices. We will do that by adding a bsg device node to the ufs driver, and use it to send UPIU transactions to the ufs device. It will serve as a ufs device management infrastructure, for device configuration, provisioning, testing and valid

Re: dm-mpath: Fix setup_scsi_dh()

2018-09-17 Thread Bart Van Assche
On 9/17/18 8:11 AM, Mike Snitzer wrote: Moving kfree() into setup_scsi_dh() would require use of a common goto for cleanup (something parse_path() already has with 'goto bad;'). But having kfree() in parse_path() is cleaner/symmetric since call to scsi_dh_attached_handler_name() -- and associate

Re: dm-mpath: Fix setup_scsi_dh()

2018-09-17 Thread Mike Snitzer
On Mon, Sep 17 2018 at 10:51am -0400, Bart Van Assche wrote: > On 9/17/18 7:20 AM, Mike Snitzer wrote: > >>- Avoid that m->hw_handler_name becomes a dangling pointer if the > >> RETAIN_ATTACHED_HW_HANDLER flag is set and scsi_dh_attach() returns > >> -EBUSY. > > > >What is the concern about a

[PATCH 7/7] mpt3sas: Remove unused macro MPT3SAS_FMT

2018-09-17 Thread Joe Perches
All the uses have been removed, delete the macro. Signed-off-by: Joe Perches --- drivers/scsi/mpt3sas/mpt3sas_base.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 941a4faf20be..8f1d6b071b39 100644 --- a/drive

[PATCH 6/7] mpt3sas: Convert logging uses with MPT3SAS_FMT without logging levels

2018-09-17 Thread Joe Perches
Convert these uses to ioc_ where appropriate. Signed-off-by: Joe Perches --- drivers/scsi/mpt3sas/mpt3sas_base.c | 41 +++- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 12 +- drivers/scsi/mpt3sas/mpt3sas_transport.c | 6 ++--- 3 files changed, 28 insertio

[PATCH 3/7] mpt3sas: Convert mlsleading uses of pr_ with MPT3SAS_FMT

2018-09-17 Thread Joe Perches
These have misordered uses of __func__ and ioc->name that could mismatch MPT3SAS_FMT and "%s: ". Convert them to ioc_. Signed-off-by: Joe Perches --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 50 +++- drivers/scsi/mpt3sas/mpt3sas_transport.c | 18 2 fil

[PATCH 1/7] mpt3sas: Add ioc_ logging macros

2018-09-17 Thread Joe Perches
These macros can help identify specific logging uses and eventually perhaps reduce object sizes. Signed-off-by: Joe Perches --- drivers/scsi/mpt3sas/mpt3sas_base.h | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_bas

[PATCH 0/7] Neaten logging uses

2018-09-17 Thread Joe Perches
Several defects exist in the logging uses o Missing KERN_ o Unnecessary KERN_ uses with panic o Mismatched MPT3SAS_FMT and %s: with name and __func__ Correct these defects and perhaps add some clarity to the logging. Joe Perches (7): mpt3sas: Add ioc_ logging macros mpt3sas: Convert uses of

[PATCH 4/7] mpt3sas: Convert logging uses with MPT3SAS_FMT and reply_q_name to %s:

2018-09-17 Thread Joe Perches
Convert the existing 2 uses to make the format and arguments matching more obvious. Miscellanea: o Move the word "enabled" into the format to trivially reduce object size o Remove unnecessary parentheses Signed-off-by: Joe Perches --- drivers/scsi/mpt3sas/mpt3sas_base.c | 10 +- 1 file

[PATCH 5/7] mpt3sas: Remove KERN_WARNING from panic uses

2018-09-17 Thread Joe Perches
Remove the logging level as panic calls stop the machine and should always be emitted regardless of requested logging level. These existing panic uses are perhaps inappropriate. Miscellanea: o Coalesce formats and convert MPT3SAS_FMT to "%s: " to improve clarity Signed-off-by: Joe Perches ---

Re: dm-mpath: Fix setup_scsi_dh()

2018-09-17 Thread Bart Van Assche
On 9/17/18 7:20 AM, Mike Snitzer wrote: - Avoid that m->hw_handler_name becomes a dangling pointer if the RETAIN_ATTACHED_HW_HANDLER flag is set and scsi_dh_attach() returns -EBUSY. What is the concern about a dangling pointer? How does that manifest? Stale scsi_dh name stored in hw_hand

Re: dm-mpath: Fix setup_scsi_dh()

2018-09-17 Thread Mike Snitzer
[dropping stable@ cc and cc'ing linux-scsi instead] On Sun, Sep 16 2018 at 11:33pm -0400, Bart Van Assche wrote: > This patch fixes two bugs that got introduced recently in setup_scsi_dh(): > - Avoid that a memory leak occurs if attached_handler_name is not assigned > to m->hw_handler_name. I

Re: [PATCH 5/5] scsi: libsas: fix a race condition when smp task timeout

2018-09-17 Thread Hannes Reinecke
On 09/12/2018 10:29 AM, Jason Yan wrote: > When the lldd is processing the complete sas task in interrupt and set > the task stat as SAS_TASK_STATE_DONE, the smp timeout timer is able to > be triggered at the same time. And smp_task_timedout() will complete the > task wheter the SAS_TASK_STATE_DONE

Re: [PATCH 4/5] scsi: libsas: check the ata device status by ata_dev_enabled()

2018-09-17 Thread Hannes Reinecke
On 09/12/2018 10:29 AM, Jason Yan wrote: > When ata device IDENTIFY failed, the ata device status is > ATA_DEV_UNKNOWN. The libata reported like: > > [113518.620433] ata5.00: qc timeout (cmd 0xec) > [113518.653646] ata5.00: failed to IDENTIFY (I/O error, err_mask=0x4) > > But libsas verifies the

Re: [PATCH 3/5] scsi: libsas: always unregister the old device if going to discover new

2018-09-17 Thread Hannes Reinecke
On 09/12/2018 10:29 AM, Jason Yan wrote: > If we went into sas_rediscover_dev() the attached_sas_addr was already > insured not to be zero. So it's unnecessary to check if the > attached_sas_addr is zero. > > And although if the sas address is not changed, we always have to > unregister the old de

Re: [PATCH 2/5] scsi: libsas: check the lldd callback correctly

2018-09-17 Thread Hannes Reinecke
On 09/12/2018 10:29 AM, Jason Yan wrote: > We are using lldd_port_deformed so we'd better check if lldd_port_deformed > is NULL. > > After this, we can remove hisi_sas_port_deformed() because it is just a > stub to avoid a NULL dereference caused by the wrong check. > > Signed-off-by: Jason Yan

Re: [PATCH 1/5] scsi: libsas: delete dead code in scsi_transport_sas.c

2018-09-17 Thread Hannes Reinecke
On 09/12/2018 10:29 AM, Jason Yan wrote: > This code is dead and no clue implies that it will be back again. > > Signed-off-by: Jason Yan > CC: John Garry > CC: Johannes Thumshirn > CC: Ewan Milne > CC: Christoph Hellwig > CC: Tomas Henzl > CC: Dan Williams > CC: Hannes Reinecke > Reviewed

Re: [PATCH V3 11/17] SCSI: track pending admin commands

2018-09-17 Thread Ming Lei
On Mon, Sep 17, 2018 at 10:46:34AM +0800, jianchao.wang wrote: > Hi Ming > > On 09/14/2018 07:33 PM, Ming Lei wrote: > > On Fri, Sep 14, 2018 at 11:40 AM jianchao.wang > > wrote: > >> > >> Hi Ming > >> > >> On 09/13/2018 08:15 PM, Ming Lei wrote: > >>> EXPORT_SYMBOL(__scsi_execute); > >>> @@ -32

RE: [PATCH v4 4/7] scsi: ufs: Add ufs-bsg module

2018-09-17 Thread Avri Altman
> > > @@ -5,6 +5,9 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc- > dwc-g210-pltfrm.o ufshcd-dwc.o tc-d > > obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o > > obj-$(CONFIG_SCSI_UFSHCD) += ufshcd-core.o > > ufshcd-core-objs := ufshcd.o ufs-sysfs.o > > +ifeq ($(CONFIG_SCSI_UFS_BSG),y) > > +ufshcd

Re: [PATCH 5/5] scsi: libsas: fix a race condition when smp task timeout

2018-09-17 Thread John Garry
On 12/09/2018 09:29, Jason Yan wrote: When the lldd is processing the complete sas task in interrupt and set the task stat as SAS_TASK_STATE_DONE, the smp timeout timer is able to be triggered at the same time. And smp_task_timedout() will complete the task wheter the SAS_TASK_STATE_DONE is set o

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-17 Thread Jonathan Cameron
On Wed, 12 Sep 2018 17:08:52 +0200 Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architecture,

Re: [PATCH 1/5] scsi: libsas: delete dead code in scsi_transport_sas.c

2018-09-17 Thread John Garry
On 12/09/2018 09:29, Jason Yan wrote: This code is dead and no clue implies that it will be back again. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke Reviewed-by: Johannes Thumshirn

Re: [PATCH 2/5] scsi: libsas: check the lldd callback correctly

2018-09-17 Thread John Garry
On 12/09/2018 09:29, Jason Yan wrote: We are using lldd_port_deformed so we'd better check if lldd_port_deformed is NULL. After this, we can remove hisi_sas_port_deformed() because it is just a stub to avoid a NULL dereference caused by the wrong check. Signed-off-by: Jason Yan Acked-by: Joh

Re: [PATCH -next] scsi: qla2xxx: Remove set but not used variable 'ptr_dma'

2018-09-17 Thread Martin K. Petersen
YueHaibing, > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/scsi/qla2xxx/qla_iocb.c: In function 'qla24xx_els_dcmd2_iocb': > drivers/scsi/qla2xxx/qla_iocb.c:2644:13: warning: > variable 'ptr_dma' set but not used [-Wunused-but-set-variable] Applied to 4.20/scsi-queue. Thanks! --

Re: [PATCH -next] scsi: lpfc: Remove set but not used variable 'sgl_size'

2018-09-17 Thread Martin K. Petersen
YueHaibing, > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_new_nvme_buf': > drivers/scsi/lpfc/lpfc_nvme.c:2238:24: warning: > variable 'sgl_size' set but not used [-Wunused-but-set-variable] > int bcnt, num_posted, sgl_size; >