Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Bart Van Assche
On 06/24/14 17:07, Maurizio Lombardi wrote: I've a question regarding the asynchronous scsi abort handler, look at the scsi_put_command() function: void scsi_put_command(struct scsi_cmnd *cmd) { unsigned long flags; [...] cancel_delayed_work(cmd-abort_work);

Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Maurizio Lombardi
Hi Bart, On 06/25/2014 08:52 AM, Bart Van Assche wrote: Hello Maurizio, I agree that that cancel_delayed_work() call is confusing. Hence [PATCH] Remove two cancel_delayed_work() calls from the mid-layer (http://thread.gmane.org/gmane.linux.scsi/91027). Had you already noticed that patch ?

Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Bart Van Assche
On 06/25/14 09:03, Maurizio Lombardi wrote: On 06/25/2014 08:52 AM, Bart Van Assche wrote: I agree that that cancel_delayed_work() call is confusing. Hence [PATCH] Remove two cancel_delayed_work() calls from the mid-layer (http://thread.gmane.org/gmane.linux.scsi/91027). Had you already

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Sagi Grimberg
On 6/25/2014 6:32 AM, Mike Christie wrote: On 06/24/2014 12:08 PM, Mike Christie wrote: On 06/24/2014 12:00 PM, Mike Christie wrote: On 06/24/2014 11:30 AM, Christoph Hellwig wrote: On Tue, Jun 24, 2014 at 07:27:46PM +0300, Sagi Grimberg wrote: This condition only matters in the bidi case,

Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 09:45:07AM +0200, Bart Van Assche wrote: Hello James and Christoph, Is it correct that the patch mentioned above has not yet been queued up ? Has it already been decided in which kernel version that patch should be included ? I've got it in my local pending queue for

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Christoph Hellwig
Mike, I'd prefer a fix on top of the core-for-3.16 branch in my scsi-queue tree, which already has the fix from Martin. I also really don't like these three confusing helpers: +static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd) +{ + return

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Christoph Hellwig
Sagi's patch was not correct because scsi_in was hardcoded to the transfer len when bidi was used. Right, should have condition that in the direction. something like: transfer_length = sc-sc_data_direction == DMA_TO_DEVICE ? scsi_out(sc)-length : scsi_in(sc)-length; would probably hit

RE: mptNsas MSI-X fixes

2014-06-25 Thread Sreekanth Reddy
Hi James, This Patch set seems to be fine. Please consider this patch set as Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com Regards, Sreekanth -Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Martin K. Petersen

RE: [PATCH 0/4] mpt2/mpt3 static checker fixups

2014-06-25 Thread Sreekanth Reddy
James, This Patch set seems to be fine. Please consider this patch set as Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com Regards, Sreekanth -Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Joe Lawrence Sent:

Re: sd_setup_discard_cmnd: BUG: unable to handle kernel NULL pointer dereference at (null)

2014-06-25 Thread Lars Ellenberg
On Tue, Jun 24, 2014 at 07:11:47PM -0400, Martin K. Petersen wrote: Lars == Lars Ellenberg lars.ellenb...@linbit.com writes: Lars We are receiving (from network) and submitting (to lower level IO Lars stack) in the same context and would like the submit to be async. Lars Do you intend to

Re: [PATCH 08/14] block: Add a disk flag to block integrity profile

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 11, 2014 at 09:30:34PM -0400, Martin K. Petersen wrote: /sys/block/foo/integrity/disk_is_formatted_with_pi /sys/block/foo/integrity/disk_is_integrity_capable /sys/block/foo/integrity/disk_supports_storing_pi Or would you prefer something other than disk? target? storage_device?

[PATCH][SCSI]mpt2sas: Description Patch

2014-06-25 Thread Reddy, Sreekanth
Just resending below set of patches which I have sent on 14th March 2014. And I have removed below subjected patch since we have already have the module parameter port_mask to disable EEDP support. [PATCH 02/11][SCSI]mpt2sas: Added new driver module Parameter disable_eedp to Disable EEDP Support.

[RESEND][PATCH 01/10][SCSI]mpt2sas: Added driver module parameter max_msix_vectors

2014-06-25 Thread Reddy, Sreekanth
Added driver module parameter max_msix_vectors. Using this module parameter the maximum number of MSI-X vectors could be set. The number of MSI-X vectors used would be the minimum of MSI-X vectors supported by the HBA, the number of CPU cores and the value set to max_msix_vectors module

[RESEND][PATCH 06/10][SCSI]mpt2sas: For 2TB volumes, DirectDrive support sends IO's with LBA bit 31 to IR FW instead of DirectDrive

2014-06-25 Thread Reddy, Sreekanth
There was a down casting of the volume max LBA from a U64 to a U32, which is taken out and now the max LBA is set appropriately to U64. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 14 ++ 1 files changed, 10 insertions(+),

[RESEND][PATCH 05/10][SCSI]mpt2sas: Bump mpt2sas driver version to 17.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 17.100.00.00. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h

[RESEND][PATCH 07/10][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-06-25 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory pool for all reply queues and passes down a single address in the ReplyDescriptorPostQueueAddress field of the IOC Init Request Message to the firmware. When firmware receives this address, it will program each of the Reply

[RESEND][PATCH 09/10][SCSI]mpt2sas: Added module parameter 'unblock_io' to unblock IO's during disk addition

2014-06-25 Thread Reddy, Sreekanth
During hot-plugging of a disk(having a flaky link) the disk addition stops and any further disk addition or removal doesn't happen on that controller. This is because, when driver receives DELAY_NOT_RESPONDING for a disk when it is undergoing addition in the SCSI Mid layer, the driver would

[RESEND][PATCH 08/10][SCSI]mpt2sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state

2014-06-25 Thread Reddy, Sreekanth
The driver would send IOC facts only if HBA is in operational or ready state. If it is in fault state, a diagnostic reset would be issued. It would wait for 10 seconds to exit out of reset state. If the HBA continues to be in reset state, then the HBA wouldn't be claimed by the driver.

[RESEND][PATCH 10/10][SCSI]mpt2sas: Bump mpt2sas driver version to 18.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 18.100.00.00. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h

[PATCH][SCSI]mpt3sas: Description Patch

2014-06-25 Thread Reddy, Sreekanth
Just resending below set of patches which I have sent on 14th March 2014. And I have removed below subjected patch since we have already have the module parameter port_mask to disable EEDP support. [PATCH 1/9][SCSI]mpt3sas: Added new driver module Parameter disable_eedp to Disable EEDP Support.

[RESEND][PATCH 1/8][SCSI]mpt3sas: MPI2.5 Rev G (2.5.2) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev G specification and 2.00.31 header files 1) Added SCSIStatusQualifier to SCSI IO Error Reply message. 2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field. 3) Added Allow Protection Information bit for IR Volume Create. Signed-off-by: Sreekanth

[RESEND][PATCH 2/8][SCSI]mpt3sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-06-25 Thread Reddy, Sreekanth
Added code to send an SEP message that turns off the Predictive Failure LED when a drive is removed (if Predictive Failure LED was turned on). Added a new flag 'pfa_led_on' per device that tracks the status of Predictive Failure LED. When the drive is removed, this flag is checked and sends an

[RESEND][PATCH 4/8][SCSI]mpt3sas: MPI2.5 Rev H (2.5.3) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev H specification and 2.00.32 header files 1) Added reserved fields to IO Unit Page 7 for future use. 2) Added optional functionality to IOCInit Request so that the host may specify a separate base address for each Reply Descriptor Post Queue. IOC support

[RESEND][PATCH 6/8][SCSI]mpt3sas: Added OEM branding Strings

2014-06-25 Thread Reddy, Sreekanth
Added following branding Strings for Intel custom HBAs support. Driver String: Vendor ID Device ID SubSystemVendor ID SubSystemDevice ID Intel(R) Integrated RAID Module RMS3JC080 0x1000 0x0097 0x8086

[RESEND][PATCH 5/8][SCSI]mpt3sas: Copyright in driver sources is updated for year the 2014

2014-06-25 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt3sas/Kconfig|2 +- drivers/scsi/mpt3sas/mpi/mpi2.h |2 +- drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h|2 +-

[RESEND][PATCH 3/8][SCSI]mpt3sas: Bump mpt3sas driver version to 03.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 03.100.00.00. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h

[RESEND][PATCH 8/8][SCSI]mpt3sas: Bump mpt3sas driver version to 04.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 04.100.00.00. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h

[RESEND][PATCH 7/8][SCSI]mpt3sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-06-25 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory pool for all reply queues and passes down a single address in the ReplyDescriptorPostQueueAddress field of the IOC Init Request Message to the firmware. When firmware receives this address, it will program each of the Reply

[RESEND][PATCH 03/10][SCSI]mpt2sas: Copyright in driver sources is updated for year the 2014

2014-06-25 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014. Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/Kconfig |2 +- drivers/scsi/mpt2sas/mpt2sas_base.c |2 +- drivers/scsi/mpt2sas/mpt2sas_base.h |2 +-

[RESEND][PATCH 02/10][SCSI]mpt2sas: MPI2 Rev Y (2.00.17) and Rev Z (2.00.18) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2 Rev Y specification and in 2.00.17 header files 1) Added SCSIStatusQualifier to SCSI IO Error Reply message. 2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field. Below is the change set in MPI2 Rev Z specification and in 2.00.19 header files 1) Added

[RESEND][PATCH 04/10][SCSI]mpt2sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-06-25 Thread Reddy, Sreekanth
Added code to send a SEP message that turns off the Predictive Failure LED when a drive is removed (if Predictive Failure LED was turned on). Added a new flag 'pfa_led_on' per device that tracks the status of Predictive Failure LED. When the drive is removed, this flag is checked and sends the

Re: [PATCH 1/1] Add defines for new FC port speeds.

2014-06-25 Thread Christoph Hellwig
Can I get another review for this one? On Fri, Jun 13, 2014 at 04:40:36PM +, Dick Kennedy wrote: These speeds are to support the next generation of FCoE port speeds. Signed-off-by: rkenn...@emulex.com --- drivers/scsi/scsi_transport_fc.c |4 include/scsi/scsi_transport_fc.h |

Re: [PATCH 0/7] mptfusion static checker fixups

2014-06-25 Thread Christoph Hellwig
Can I get another review for this series? On Wed, Jun 04, 2014 at 12:49:42PM -0400, Joe Lawrence wrote: While reviewing the mpt2/mpt3 static checker fixup patchset, Christoph inquired about mptfusion. None of the sparse / smatch warnings from the earlier patchset directly apply to fusion, but

Re: [PATCH V1 0/4] LU queue depth manament

2014-06-25 Thread Christoph Hellwig
On Thu, Jun 05, 2014 at 03:44:18PM +0300, Dolev Raviv wrote: Resending patch 4, to fix the author. Please resend the whole series, and include all the existing reviewed-by or acked-by tags. Thanks! -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message

Re: [PATCH 0/4] ARM randconfig fixes for SCSI

2014-06-25 Thread Christoph Hellwig
Can I get another set of reviews for these? On Thu, Jun 05, 2014 at 11:29:45PM +0200, Arnd Bergmann wrote: Hi James, These are some fixes for ancient randconfig build bugs I ran into on ARM. Clearly none of these are urgent, but it would be nice to have them merged for 3.17 if they look

Re: [PATCH V2] scsi_lib: removes ambiguous Unhandled error code messages.

2014-06-25 Thread Christoph Hellwig
Can I get another review for this one? On Fri, Jun 06, 2014 at 10:10:35AM +0200, Maurizio Lombardi wrote: During IO with fabric faults, one generally sees several Unhandled error code messages in the syslog as shown below: sd 4:0:6:2: [sdbw] Unhandled error code sd 4:0:6:2: [sdbw] Result:

Re: [PATCH RESEND] [SCSI] aic94xx: Remove broken fallback for missing 'Ctrl-A' user settings

2014-06-25 Thread Christoph Hellwig
On Sun, Jun 08, 2014 at 11:37:44PM +0100, Ben Hutchings wrote: asd_process_ctrl_a_user() attempts to find user settings in flash, and if they are missing it prepares a substitute structure containing default values for PHY settings. But having done so, it will still try to read user settings

Re: [PATCH RESEND] [SCSI] bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA address

2014-06-25 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig h...@lst.de Can I get another review, too please? -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-25 Thread Hannes Reinecke
scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque value. And, finally, the example given should use the correct

Re: mptNsas MSI-X fixes

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 02:40:32PM +0530, Sreekanth Reddy wrote: Hi James, This Patch set seems to be fine. Please consider this patch set as Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com Any reason you didn't simply include them in your resent driver update series? Also any

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Martin K. Petersen
Christoph == Christoph Hellwig h...@infradead.org writes: Christoph So here we use blk_rq_bytes still, which is incorrect for Christoph WRITE SAME. Yeah, scsi_transfer_length() needs to go away completely if we go with the in and out variants. Christoph I think the easiest fix is to just pass

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 01:32:39PM +0300, Sagi Grimberg wrote: So I tested a bidirectional command using: $ sg_raw --infile=/root/filex --send=1024 --request=1024 --outfile=/root/filex /dev/bsg/7:0:0:0 53 00 00 00 00 00 00 00 02 00 And I see: kernel: session1: iscsi_prep_scsi_cmd_pdu iscsi

Re: [PATCH 08/14] block: Add a disk flag to block integrity profile

2014-06-25 Thread Martin K. Petersen
Christoph == Christoph Hellwig h...@infradead.org writes: Christoph On Wed, Jun 11, 2014 at 09:30:34PM -0400, Martin K. Petersen wrote: /sys/block/foo/integrity/disk_is_formatted_with_pi /sys/block/foo/integrity/disk_is_integrity_capable /sys/block/foo/integrity/disk_supports_storing_pi Or

[PATCH] scsi: advansys.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to the same value more than once This was found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- drivers/scsi/advansys.c |2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

2014-06-25 Thread Christoph Hellwig
On Tue, Jun 03, 2014 at 10:58:56AM +0200, Hannes Reinecke wrote: Now that we're using 64-bit LUNs internally we need to increase the size of max_luns to 64 bits, too. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Christoph Hellwig h...@infradead.org Reviewed-by: Ewan Milne

Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

2014-06-25 Thread Hannes Reinecke
On 06/25/2014 02:28 PM, Christoph Hellwig wrote: On Tue, Jun 03, 2014 at 10:58:56AM +0200, Hannes Reinecke wrote: Now that we're using 64-bit LUNs internally we need to increase the size of max_luns to 64 bits, too. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Christoph Hellwig

Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 02:31:31PM +0200, Hannes Reinecke wrote: Guess I need to redo the patchset yet again ... If you plan to resend it please also include these fixes for the mptfusion driver: diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index

Re: [ANNOUNCE] scsi patch queue tree

2014-06-25 Thread Christoph Hellwig
And here are the for-3.16 driver changes: Brian King (2): ibmvscsi: Abort init sequence during error recovery ibmvscsi: Add memory barriers for send / receive Maurizio Lombardi (2): pm8001: Fix potential null

Re: [PATCH 1/1] Add defines for new FC port speeds.

2014-06-25 Thread Ewan Milne
On Fri, 2014-06-13 at 16:40 +, Dick Kennedy wrote: These speeds are to support the next generation of FCoE port speeds. Signed-off-by: rkenn...@emulex.com --- drivers/scsi/scsi_transport_fc.c |4 include/scsi/scsi_transport_fc.h |4 2 files changed, 8 insertions(+), 0

Re: SCSI eats error from flush failure during hot plug

2014-06-25 Thread Christoph Hellwig
On Thu, Jun 19, 2014 at 11:05:59AM -0700, James Bottomley wrote: That's not really a good idea either ... I did think of it. We'll end up with a cmd_type of REQ_TYPE_FS which because of REQ_FLUSH (or REQ_FUA or REQ_DISCARD or any number of other things) we have to treat as though it were

[PATCH 4/4] scsi_scan: Fixup scsilun_to_int()

2014-06-25 Thread Hannes Reinecke
scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque value. And, finally, the example given should use the correct

[PATCHv5 0/4] Support 64-bit LUNs

2014-06-25 Thread Hannes Reinecke
Hi all, this patchset updates the SCSI stack to support full 64-bit LUNs. The first patche update the SCSI stack and all drivers to use 64-bit LUNs where appropriate. The second patch updates the kernel module parameter functions to accept a new 'ullong' parameter. The third the updates the

[PATCH 3/4] scsi: use 64-bit value for 'max_luns'

2014-06-25 Thread Hannes Reinecke
Now that we're using 64-bit LUNs internally we need to increase the size of max_luns to 64 bits, too. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Christoph Hellwig h...@infradead.org Reviewed-by: Ewan Milne emi...@redhat.com --- drivers/message/i2o/i2o_scsi.c | 2 +-

[PATCH 2/4] Add module param type 'ullong'

2014-06-25 Thread Hannes Reinecke
Some driver might want to pass in an 64-bit value, so introduce a module param type 'ullong'. Cc: Rusty Russel ru...@rustcorp.com.au Cc: Linux Kernel linux-ker...@vger.kernel.org Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Christoph Hellwig h...@infradead.org Reviewed-by: Ewan Milne

[PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- drivers/scsi/pm8001/pm80xx_hwi.c |1 - 1 file changed, 1

[PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- drivers/scsi/bnx2i/bnx2i_iscsi.c |1 - 1 file changed, 1

Re: [PATCH 0/7] mptfusion static checker fixups

2014-06-25 Thread Joe Lawrence
Hi Christoph, Sreekanth, Would it be easier to combine this set with the mpt2/mpt3 changes and repost a V2? There were a few changes Christoph request in each set, so I can post those up later today. -- Joe On Wed, 25 Jun 2014 13:01:50 +0200 Christoph Hellwig h...@infradead.org wrote: Can I

Re: [PATCH 0/7] mptfusion static checker fixups

2014-06-25 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 10:18:11AM -0400, Joe Lawrence wrote: Hi Christoph, Sreekanth, Would it be easier to combine this set with the mpt2/mpt3 changes and repost a V2? There were a few changes Christoph request in each set, so I can post those up later today. Fine with me. -- To

Re: [PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
Hi, On 06/25/2014 04:04 PM, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se ---

[PATCH 6/6] scsi: use dev_printk variants where possible

2014-06-25 Thread Hannes Reinecke
Using dev_printk variants prefixes the logging message with the originating device, which makes debugging easier. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Martin K. Petersen martin.peter...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/scsi/hosts.c | 15

[PATCH 5/6] scsi: use dev_printk() variants for ioctl

2014-06-25 Thread Hannes Reinecke
Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Martin K. Petersen martin.peter...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi_ioctl.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_ioctl.c

[PATCHv2 0/6] First batch of logging cleanup

2014-06-25 Thread Hannes Reinecke
Hi all, this is the first patch of my SCSI logging cleanup. The basic idea here is to use dev_printk() and friends throughout the midlayer, so that any logging messages are attached with the correct device information. This patchset is relative to the core-for-3.17 git tree from hch + my 64-bit

[PATCH 3/6] scsi: Implement ch_printk()

2014-06-25 Thread Hannes Reinecke
Update the ch driver to use dev_printk() variants instead of plain printk(); this will prefix logging messages with the appropriate device. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Martin K. Petersen martin.peter...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de ---

[PATCH 1/6] scsi: Implement sr_printk()

2014-06-25 Thread Hannes Reinecke
Update the sr driver to use dev_printk() variants instead of plain printk(); this will prefix logging messages with the appropriate device. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Martin K. Petersen martin.peter...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de ---

[PATCH 4/6] scsi: Implement st_printk()

2014-06-25 Thread Hannes Reinecke
Update the st driver to use dev_printk() variants instead of plain printk(); this will prefix logging messages with the appropriate device. Signed-off-by: Hannes Reinecke h...@suse.de Reviewed-by: Martin K. Petersen martin.peter...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de ---

[PATCH 2/6] scsi: Implement sg_printk()

2014-06-25 Thread Hannes Reinecke
Update the sg driver to use dev_printk() variants instead of plain printk(); this will prefix logging messages with the appropriate device. Signed-off-by: Hannes Reinecke h...@suse.de Acked-by: Doug Gilbert dgilb...@interlog.com Reviewed-by: Martin K. Petersen martin.peter...@oracle.com

Re: [PATCHv5 0/4] Support 64-bit LUNs

2014-06-25 Thread Christoph Hellwig
Thanks Hannes, I've applied this and the logging series to the core-for-3.17 branch. Note that I will still rebase this branch to deal with whatever feedback Rusty might have on the modparam changes. -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
This one looks good to me, Reviewed-by: Maurizio Lombardi mlomb...@redhat.com On 06/25/2014 04:01 PM, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck

[Bug 34422] Error-valued pointers used in pointer arithmetic in SCSI

2014-06-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=34422 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #1

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-25 Thread Michael Christie
On Jun 25, 2014, at 6:35 AM, Christoph Hellwig h...@infradead.org wrote: On Wed, Jun 25, 2014 at 01:32:39PM +0300, Sagi Grimberg wrote: So I tested a bidirectional command using: $ sg_raw --infile=/root/filex --send=1024 --request=1024 --outfile=/root/filex /dev/bsg/7:0:0:0 53 00 00 00 00 00

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
Hi, On 06/25/2014 05:41 PM, Purush Gupta wrote: Its possible HW may require programming those fields? I'm looking at the code and it doesn't look so, did you see something suspicious? May be original contributor of the driver should review...No offense! I believe it requires the maintainer

[PATCH 10/14] scsi: only maintain target_blocked if the driver has a target queue limit

2014-06-25 Thread Christoph Hellwig
This saves us an atomic operation for each I/O submission and completion for the usual case where the driver doesn't set a per-target can_queue value. Only a few iscsi hardware offload drivers set the per-target can_queue value at the moment. Signed-off-by: Christoph Hellwig h...@lst.de ---

scsi-mq V2

2014-06-25 Thread Christoph Hellwig
This is the second post of the scsi-mq series. At this point the code is ready for merging and use by developers and early adopters. The core blk-mq code isn't that suitable for slow devices yet, mostly due to the lack of an I/O scheduler, but Jens is working on it. Similarly there is no

[PATCH 05/14] scsi: push host_lock down into scsi_{host,target}_queue_ready

2014-06-25 Thread Christoph Hellwig
Prepare for not taking a host-wide lock in the dispatch path by pushing the lock down into the places that actually need it. Note that this patch is just a preparation step, as it will actually increase lock roundtrips and thus decrease performance on its own. Signed-off-by: Christoph Hellwig

[PATCH 14/14] fnic: reject device resets without assigned tags for the blk-mq case

2014-06-25 Thread Christoph Hellwig
Current the midlayer fakes up a struct request for the explicit reset ioctls, and those don't have a tag allocated to them. The fnic driver pokes into midlayer structures to paper over this design issue, but that won't work for the blk-mq case. Either someone who can actually test the hardware

[PATCH 13/14] scsi: add support for a blk-mq based I/O path.

2014-06-25 Thread Christoph Hellwig
This patch adds support for an alternate I/O path in the scsi midlayer which uses the blk-mq infrastructure instead of the legacy request code. Use of blk-mq is fully transparent to drivers, although for now a host template field is provided to opt out of blk-mq usage in case any unforseen

[PATCH 07/14] scsi: convert host_busy to atomic_t

2014-06-25 Thread Christoph Hellwig
Avoid taking the host-wide host_lock to check the per-host queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if nessecary decrement it after finishing all checks. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/advansys.c |4

[PATCH 12/14] scatterlist: allow chaining to preallocated chunks

2014-06-25 Thread Christoph Hellwig
Blk-mq drivers usually preallocate their S/G list as part of the request, but if we want to support the very large S/G lists currently supported by the SCSI code that would tie up a lot of memory in the preallocated request pool. Add support to the scatterlist code so that it can initialize a S/G

[PATCH 09/14] scsi: fix the {host,target,device}_blocked counter mess

2014-06-25 Thread Christoph Hellwig
Seems like these counters are missing any sort of synchronization for updates, as a over 10 year old comment from me noted. Fix this by using atomic counters, and while we're at it also make sure they are in the same cacheline as the _busy counters and not needlessly stored to in every I/O

[PATCH 11/14] scsi: unwind blk_end_request_all and blk_end_request_err calls

2014-06-25 Thread Christoph Hellwig
Replace the calls to the various blk_end_request variants with opencode equivalents. Blk-mq is using a model that gives the driver control between the bio updates and the actual completion, and making the old code follow that same model allows us to keep the code more similar for both pathes.

[PATCH 03/14] scsi: centralize command re-queueing in scsi_dispatch_fn

2014-06-25 Thread Christoph Hellwig
Make sure we only have the logic for requeing commands in one place. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi.c | 35 --- drivers/scsi/scsi_lib.c |9 ++--- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git

[PATCH 04/14] scsi: set -scsi_done before calling scsi_dispatch_cmd

2014-06-25 Thread Christoph Hellwig
The blk-mq code path will set this to a different function, so make the code simpler by setting it up in a legacy-request specific place. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi.c | 23 +-- drivers/scsi/scsi_lib.c | 20

[PATCH 02/14] scsi: split __scsi_queue_insert

2014-06-25 Thread Christoph Hellwig
Factor out a helper to set the _blocked values, which we'll reuse for the blk-mq code path. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi_lib.c | 44 ++-- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git

[PATCH 06/14] scsi: convert target_busy to an atomic_t

2014-06-25 Thread Christoph Hellwig
Avoid taking the host-wide host_lock to check the per-target queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if nessecary decrement it after finishing all checks. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/scsi_lib.c| 52

[PATCH 08/14] scsi: convert device_busy to atomic_t

2014-06-25 Thread Christoph Hellwig
Avoid taking the queue_lock to check the per-device queue limit. Instead we do an atomic_inc_return early on to grab our slot in the queue, and if nessecary decrement it after finishing all checks. Unlike the host and target busy counters this doesn't allow us to avoid the queue_lock in the

[PATCH 01/14] sd: don't use rq-cmd_len before setting it up

2014-06-25 Thread Christoph Hellwig
Unlike the old request code blk-mq doesn't initialize cmd_len with a default value, so don't rely on it being set in sd_setup_write_same_cmnd. Signed-off-by: Christoph Hellwig h...@lst.de --- drivers/scsi/sd.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-25 Thread Linus Torvalds
Al, just checking - did you expect me to take this from the email, or are you preparing a pull request? Linus On Mon, Jun 23, 2014 at 12:44 AM, Al Viro v...@zeniv.linux.org.uk wrote: OK, here it is, hopefully with sufficient comments: -- To unsubscribe from this list: send the

[PATCH] sg: limit maximum cdb size to 252 bytes

2014-06-25 Thread Douglas Gilbert
Boaz Harrosh commented on the [PATCH v5] sg: relax 16 byte cdb restriction thread that SCSI variable length commands (which are all SCSI commands greater than 16 bytes long) must themselves be a multiple of 4 bytes long. ChangeLog - limit the maximum cdb size permitted by the sg v3

Re: [PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Eddie Wai
On Wed, 2014-06-25 at 16:26 +0200, Maurizio Lombardi wrote: Hi, On 06/25/2014 04:04 PM, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck

Re: [PATCH V2] scsi_lib: removes ambiguous Unhandled error code messages.

2014-06-25 Thread Mike Christie
On 06/06/2014 03:10 AM, Maurizio Lombardi wrote: During IO with fabric faults, one generally sees several Unhandled error code messages in the syslog as shown below: sd 4:0:6:2: [sdbw] Unhandled error code sd 4:0:6:2: [sdbw] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK sd 4:0:6:2:

Re: [PATCH 00/22] Add and use pci_zalloc_consistent

2014-06-25 Thread John W. Linville
On Mon, Jun 23, 2014 at 06:41:28AM -0700, Joe Perches wrote: Adding the helper reduces object code size as well as overall source size line count. It's also consistent with all the various zalloc mechanisms in the kernel. Done with a simple cocci script and some typing. Joe Perches

Re: [PATCH 2/6] scsi: Implement sg_printk()

2014-06-25 Thread Douglas Gilbert
On 14-06-25 10:39 AM, Hannes Reinecke wrote: Update the sg driver to use dev_printk() variants instead of plain printk(); this will prefix logging messages with the appropriate device. Signed-off-by: Hannes Reinecke h...@suse.de Acked-by: Doug Gilbert dgilb...@interlog.com ^^^ A

RE: [PATCH V2] scsi_lib: removes ambiguous Unhandled error code messages.

2014-06-25 Thread Elliott, Robert (Server Storage)
-Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Christoph Hellwig Sent: Wednesday, 25 June, 2014 6:07 AM To: Maurizio Lombardi Cc: james.bottom...@hansenpartnership.com; linux-scsi@vger.kernel.org;

[PATCH v2 00/11] mptfusion/mpt2/mpt3 static checker fixups

2014-06-25 Thread Joe Lawrence
v2: Combined the mptfusion and mpt{2,3}sas static checker patches, re-ordering them by driver. Updated Reviewed-by and Acked-by tags as well as Sreekanth's email address. Based off v3.16-rc2, compile tested. patches dropped: * mpt3sas: fix possible memory leak in

[PATCH v2 01/11] mpt2sas: correct scsi_{target,device} hostdata allocation

2014-06-25 Thread Joe Lawrence
In _scsih_{slave,target}_alloc, an incorrect structure type is passed to sizeof() when allocating storage for hostdata. Luckily larger structure types were used, so at least the wrong sizes were safe: struct scsi_device (1784 bytes) struct MPT2SAS_DEVICE (24 bytes) struct scsi_target (760

[PATCH v2 04/11] mpt3sas: correct scsi_{target,device} hostdata allocation

2014-06-25 Thread Joe Lawrence
In _scsih_{slave,target}_alloc, an incorrect structure type is passed to sizeof() when allocating storage for hostdata. Luckily larger structure types were used, so at least the wrong sizes were safe: struct scsi_device (1784 bytes) struct MPT3SAS_DEVICE (24 bytes) struct scsi_target (760

[PATCH v2 03/11] mpt2sas: annotate ioc-reply_post_host_index as __iomem

2014-06-25 Thread Joe Lawrence
The MPT2SAS_ADAPTER reply_post_host_index[] holds calculated addresses in memory mapped register space. Add an __iomem annotation to silence the following sparse warnings: drivers/scsi/mpt2sas/mpt2sas_base.c:1006:43: warning: incorrect type in argument 2 (different address spaces)

[PATCH v2 05/11] mpt3sas: combine fw_event_work and its event_data

2014-06-25 Thread Joe Lawrence
Tack the firmware reply event_data payload to the end of its corresponding struct fw_event_work allocation. This matches the convention in the mptfusion driver and simplifies the code. This avoids the following smatch warning: drivers/scsi/mpt3sas/mpt3sas_scsih.c:2519

[PATCH v2 06/11] mptfusion: mark file-private functions as static

2014-06-25 Thread Joe Lawrence
Fixes the following sparse warnings: drivers/message/fusion/mptbase.c:7011:1: warning: symbol 'mpt_SoftResetHandler' was not declared. Should it be static? drivers/message/fusion/mptsas.c:1578:23: warning: symbol 'mptsas_refreshing_device_handles' was not declared. Should it be

[PATCH v2 09/11] mptfusion: make adapter prod_name[] a pointer

2014-06-25 Thread Joe Lawrence
The struct _MPT_ADAPTER doesn't need a full copy of the product string, so prod_name can point to the string literal storage that the driver already provides. Avoids the following smatch warning: drivers/message/fusion/mptbase.c:2858 MptDisplayIocCapabilities() warn: this array is probably

  1   2   >