RE: [PATCH 07/19] Fix RCU handling of scsi_device.vpd_pg8[03]

2017-08-24 Thread Seymour, Shane M
> -Original Message- > From: Bart Van Assche [mailto:bart.vanass...@wdc.com] > Sent: Friday, August 25, 2017 2:54 AM > To: h...@lst.de > Cc: j...@linux.vnet.ibm.com; linux-scsi@vger.kernel.org; h...@suse.de; > jthumsh...@suse.de; martin.peter...@oracle.com; Seymour, Shane M >

Re: [PATCH] scsi: Fix the kerneldoc for scsi_initialize_rq()

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 16:11 -0600, Jonathan Corbet wrote: > /** > * scsi_initialize_rq - initialize struct scsi_cmnd.req > + * @rq: Request used to locate the scsi_cmnd structure. > * > * Called from inside blk_get_request(). > */ Since the request structure and the SCSI command

[PATCH 1/2] scsi: lpfc: avoid an unused function warning

2017-08-24 Thread Arnd Bergmann
The only reference to lpfc_nvmet_replenish_context() is inside of an #ifdef, leading to a harmless warning when CONFIG_NVME_TARGET_FC is disabled: drivers/scsi/lpfc/lpfc_nvmet.c:1457:1: error: 'lpfc_nvmet_replenish_context' defined but not used [-Werror=unused-function] This replaces the

[PATCH v3 2/2] scsi: lpfc: avoid false-positive gcc-8 warning

2017-08-24 Thread Arnd Bergmann
This is an interesting regression with gcc-8, showing a harmless warning for correct code: In file included from include/linux/kernel.h:13:0, ... from drivers/scsi/lpfc/lpfc_debugfs.c:23: include/linux/printk.h:301:2: error: 'eq' may be used uninitialized in this

[PATCH] scsi: Fix the kerneldoc for scsi_initialize_rq()

2017-08-24 Thread Jonathan Corbet
The kerneldoc comment for scsi_initialize_rq() neglected to document the "rq" parameter, leading to this docs build warning: ./drivers/scsi/scsi_lib.c:1116: warning: No description found for parameter 'rq' Document the parameter and make the build slightly quieter. Signed-off-by: Jonathan

[bug report] scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown

2017-08-24 Thread Dan Carpenter
Hello Quinn Tran, This is a semi-automatic email about new static checker warnings. The patch 821c9f4cab5e: "scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown" from Aug 23, 2017, leads to the following Smatch complaint: drivers/scsi/qla2xxx/qla_target.c:1553

[bug report] scsi: lpfc: Fix handling of FCP and NVME FC4 types in Pt2Pt topology

2017-08-24 Thread Dan Carpenter
Hello Dick Kennedy, This is a semi-automatic email about new static checker warnings. The patch 8fd5f79a9cf4: "scsi: lpfc: Fix handling of FCP and NVME FC4 types in Pt2Pt topology" from Aug 23, 2017, leads to the following Smatch complaint: drivers/scsi/lpfc/lpfc_els.c:2010

Re: [Patch v2 1/2] libiscsi: Fix use-after-free race during iscsi_session_teardown

2017-08-24 Thread Khazhismel Kumykov
On Thu, Jul 13, 2017 at 9:11 AM, Khazhismel Kumykov wrote: Ping in case this was missed smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH 11/15] remoteproc: make device_type const

2017-08-24 Thread Bjorn Andersson
On Sat 19 Aug 01:22 PDT 2017, Bhumika Goyal wrote: > Make this const as it is only stored in the type field of a device > structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal Applied, thanks. Regards, Bjorn > --- >

Re: [PATCH 06/19] Document which queue type a function is intended for

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 18:58 +0200, h...@lst.de wrote: > On Thu, Aug 24, 2017 at 04:57:03PM +, Bart Van Assche wrote: > > Is something like the patch below perhaps what you had in mind? > > Yes. Except that I really don't like the sq naming - blk-mq can > also be used for single queues, so

Re: [PATCH] Improve requeuing behavior

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 18:57 +0200, h...@lst.de wrote: > On Thu, Aug 24, 2017 at 04:14:22PM +, Bart Van Assche wrote: > > Commit ca18d6f769d2 ("block: Make most scsi_req_init() calls implicit") > > introduced the scsi_initialize_rq() function in such a way that it is not > > only > > called

Re: [PATCH 06/19] Document which queue type a function is intended for

2017-08-24 Thread h...@lst.de
On Thu, Aug 24, 2017 at 04:57:03PM +, Bart Van Assche wrote: > Is something like the patch below perhaps what you had in mind? Yes. Except that I really don't like the sq naming - blk-mq can also be used for single queues, so it's a rather confusing name Something like legacy or old seems to

Re: [PATCH 06/19] Document which queue type a function is intended for

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 11:05 +0200, Christoph Hellwig wrote: > On Wed, Aug 23, 2017 at 02:39:56PM -0700, Bart Van Assche wrote: > > Document which queue type a function is intended for if this is not > > easy to derive from the function name. > > How about adding mq and legacy to the function

Re: [PATCH] Improve requeuing behavior

2017-08-24 Thread h...@lst.de
On Thu, Aug 24, 2017 at 04:14:22PM +, Bart Van Assche wrote: > Commit ca18d6f769d2 ("block: Make most scsi_req_init() calls implicit") > introduced the scsi_initialize_rq() function in such a way that it is not only > called for pass-through requests but also for FS requests. Because that

Re: [PATCH 07/19] Fix RCU handling of scsi_device.vpd_pg8[03]

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 11:07 +0200, Christoph Hellwig wrote: > On Wed, Aug 23, 2017 at 02:39:57PM -0700, Bart Van Assche wrote: > > Only annotate pointers that are shared across threads with __rcu. > > Use rcu_dereference() when dereferencing an RCU pointer. Protect > > also the RCU pointer

Re: [PATCH 03/15] [media] i2c: make device_type const

2017-08-24 Thread Guennadi Liakhovetski
On Sat, 19 Aug 2017, Bhumika Goyal wrote: > Make this const as it is only stored in the type field of a device > structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal Acked-by: Guennadi Liakhovetski Thanks Guennadi >

Re: [PATCH 17/19] scsi_transport_srp: Suppress a W=1 compiler warning

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 11:11 +0200, Christoph Hellwig wrote: > On Wed, Aug 23, 2017 at 02:40:07PM -0700, Bart Van Assche wrote: > > Avoid that the following compiler warning is reported when building > > with W=1: > > > > drivers/scsi/scsi_transport_srp.c:92:19: warning: comparison is always > >

Re: [PATCH v2] scsi: lpfc: avoid false positive gcc-8 warning

2017-08-24 Thread James Smart
On 8/24/2017 4:01 AM, Arnd Bergmann wrote: I have also come up with a different workaround of my own (sorry for the broken formatting here) and tested it successfully over night. I have definitely spent more time on it than it was worth now. Let me know if you prefer that version over yours,

Re: [PATCH 08/15] PCI: make device_type const

2017-08-24 Thread Bjorn Helgaas
On Sat, Aug 19, 2017 at 01:52:19PM +0530, Bhumika Goyal wrote: > Make this const as it is only stored in the type field of a device > structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal Applied to pci/misc for v4.14, thanks! > --- >

Re: [PATCH 05/19] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 11:05 +0200, Christoph Hellwig wrote: > I don't really see the point of doing more work in exactly the same > amount of code here, especially given that this is the fast path. > > Do you need this for any future patches? Hello Christoph, I will drop this patch. Bart.

Re: [PATCH] scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test

2017-08-24 Thread Gustavo A. R. Silva
Hi Martin, On 08/23/2017 09:45 PM, Martin K. Petersen wrote: Gustavo, Remove variable assignments. The value stored in local variable _rc_ is overwritten at line 2448:rc = lpfc_sli4_bsg_set_link_diag_state(phba, 0); before it can be used. Applied to 4.14/scsi-queue. Thank you! Glad to

Re: [PATCH] Improve requeuing behavior

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 14:09 +0200, Christoph Hellwig wrote: > On Wed, Aug 23, 2017 at 02:05:35PM -0700, Bart Van Assche wrote: > > Requests are unprepared and reprepared when being requeued. Avoid > > that requeuing resets .jiffies_at_alloc and .retries by initializing > > these two member

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 14:21 +0200, Hannes Reinecke wrote: > On 08/23/2017 08:25 PM, Bart Van Assche wrote: > > sas_function_template.smp_handler implementations either return > > 0 or a Unix error code. Convert that error code into a SCSI > > result. This patch is what I came up with after having

Re: [PATCH v2 0/1] bsg: fix regression resulting in panics when sending commands via BSG

2017-08-24 Thread Jens Axboe
On 08/23/2017 05:57 PM, Benjamin Block wrote: > Hello all, > > This is the second try for fixing the regression in the BSG-interface that > exists since v4.11 (for more infos see the first series). > > I separated my other changes from the bug-fix so that it is easier to apply > if judged good.

Re: [PATCH v2 1/1] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-08-24 Thread Benjamin Block
On Thu, Aug 24, 2017 at 10:45:56AM +0200, Christoph Hellwig wrote: > > /** > > - * bsg_destroy_job - routine to teardown/delete a bsg job > > + * bsg_teardown_job - routine to teardown a bsg job > > * @job: bsg_job that is to be torn down > > */ > > -static void bsg_destroy_job(struct kref

[PATCH] ses: Fix racy cleanup of /sys in remove_dev()

2017-08-24 Thread Hannes Reinecke
From: Calvin Owens Currently we free the resources backing the enclosure device before we call device_unregister(). This is racy: during rmmod of low-level SCSI drivers that hook into enclosure, we end up with a small window of time during which writing to /sys can OOPS.

[PATCH] mptsas: Fixup device hotplug for VMWare ESXi

2017-08-24 Thread Hannes Reinecke
VMWare ESXi emulates an mptsas HBA, but exposes all drives as direct-attached SAS drives. This it not how the driver originally envisioned things; SAS drives were supposed to be connected via an expander, and only SATA drives would be direct attached. As such any hotplug event for direct-attach

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Hannes Reinecke
On 08/23/2017 08:25 PM, Bart Van Assche wrote: > sas_function_template.smp_handler implementations either return > 0 or a Unix error code. Convert that error code into a SCSI > result. This patch is what I came up with after having analyzed > the following sparse warnings: > >

Re: [PATCH] Improve requeuing behavior

2017-08-24 Thread Christoph Hellwig
On Wed, Aug 23, 2017 at 02:05:35PM -0700, Bart Van Assche wrote: > Requests are unprepared and reprepared when being requeued. Avoid > that requeuing resets .jiffies_at_alloc and .retries by initializing > these two member variables from inside blk_get_request() and by > preserving both member

Re: [PATCH] scsi: sd: remove duplicated setting of gd->minors

2017-08-24 Thread weiping zhang
On Fri, Aug 18, 2017 at 02:49:30PM +0800, weiping zhang wrote: > gd->minors has been set when call alloc_disk() in sd_probe. > > Signed-off-by: weiping zhang > --- > drivers/scsi/sd.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/scsi/sd.c

Re: [PATCH v2] scsi: lpfc: avoid false positive gcc-8 warning

2017-08-24 Thread Arnd Bergmann
On Thu, Aug 24, 2017 at 2:34 AM, James Smart wrote: > Arnd Bergmann, testing gcc-8, encountered the following: > >> This is an interesting regression with gcc-8, showing a harmless >> warning for correct code: >> >>In file included from include/linux/kernel.h:13:0, >>...

Re: [PATCH 19/19] iscsi_tcp: Remove a set-but-not-used variable

2017-08-24 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 18/19] scsi_debug: Remove a set-but-not-used variable

2017-08-24 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 17/19] scsi_transport_srp: Suppress a W=1 compiler warning

2017-08-24 Thread Christoph Hellwig
On Wed, Aug 23, 2017 at 02:40:07PM -0700, Bart Van Assche wrote: > Avoid that the following compiler warning is reported when building > with W=1: > > drivers/scsi/scsi_transport_srp.c:92:19: warning: comparison is always false > due to limited range of data type [-Wtype-limits] > >

Re: [PATCH 16/19] scsi_transport_sas, sas_tlr_supported(): Check kzalloc() return value

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 15/19] libsas: Annotate fall-through in a switch statement

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 14/19] libsas: Remove a set-but-not-used variable

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 13/19] libiscsi: Fix indentation

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 12/19] sg: Fix type of last blk_trace_setup() argument

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 10/19] sd: Fix indentation

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 09/19] sd, sr: Convert two assignments into warning statements

2017-08-24 Thread Christoph Hellwig
On Wed, Aug 23, 2017 at 02:39:59PM -0700, Bart Van Assche wrote: > Before scsi_prep_fn() calls the ULP .init_command() callback > function it stores the SCSI command pointer in request.special. > This means that the SCpnt = rq->special assignments in the sd > and sr drivers assign a pointer to

Re: [PATCH 07/19] Fix RCU handling of scsi_device.vpd_pg8[03]

2017-08-24 Thread Christoph Hellwig
On Wed, Aug 23, 2017 at 02:39:57PM -0700, Bart Van Assche wrote: > Only annotate pointers that are shared across threads with __rcu. > Use rcu_dereference() when dereferencing an RCU pointer. Protect > also the RCU pointer dereferences when freeing RCU pointers. This > patch suppresses about

Re: [PATCH 08/19] Use blk_mq_rq_to_pdu() to convert a request to a SCSI command pointer

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 06/19] Document which queue type a function is intended for

2017-08-24 Thread Christoph Hellwig
On Wed, Aug 23, 2017 at 02:39:56PM -0700, Bart Van Assche wrote: > Document which queue type a function is intended for if this is not > easy to derive from the function name. How about adding mq and legacy to the function names instead?

Re: [PATCH 05/19] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-08-24 Thread Christoph Hellwig
I don't really see the point of doing more work in exactly the same amount of code here, especially given that this is the fast path. Do you need this for any future patches?

Re: [PATCH 04/19] Convert a strncmp() call into a strcmp() call

2017-08-24 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 03/19] Suppress gcc 7 fall-through warnings reported with W=1

2017-08-24 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 02/19] Avoid sign extension of scsi_device.type

2017-08-24 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 01/19] Remove an obsolete function declaration

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v2 1/1] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-08-24 Thread Christoph Hellwig
> /** > - * bsg_destroy_job - routine to teardown/delete a bsg job > + * bsg_teardown_job - routine to teardown a bsg job > * @job: bsg_job that is to be torn down > */ > -static void bsg_destroy_job(struct kref *kref) > +static void bsg_teardown_job(struct kref *kref) Why this rename? The

Re: [PATCH 02/19] Avoid sign extension of scsi_device.type

2017-08-24 Thread Hannes Reinecke
On 08/23/2017 11:39 PM, Bart Van Assche wrote: > This patch avoids that smatch reports the following: > > drivers/scsi/scsi_sysfs.c:506 scsi_bus_uevent() warn: argument 3 to %02x > specifier has type 'char' > drivers/scsi/scsi_sysfs.c:872 sdev_show_modalias() warn: argument 4 to %02x >