[PATCH v3 1/2] mpt2sas: Refcount sas_device objects and fix unsafe list usage

2015-07-31 Thread Calvin Owens
These objects can be referenced concurrently throughout the driver, we need a way to make sure threads can't delete them out from under each other. This patch adds the refcount, and refactors the code to use it. Additionally, we cannot iterate over the sas_device_list without holding the lock, or

[PATCH v3 0/2] Fixes for memory corruption in mpt2sas

2015-07-31 Thread Calvin Owens
Hello all, This patchset attempts to address problems we've been having with panics due to memory corruption from the mpt2sas driver. Changes are noted in the individual patches, I realized putting them in the cover was probably a bit confusing. Thanks, Calvin Patches in this series: [PATCH v

[PATCH v3 2/2] mpt2sas: Refcount fw_events and fix unsafe list usage

2015-07-31 Thread Calvin Owens
The fw_event_work struct is concurrently referenced at shutdown, so add a refcount to protect it, and refactor the code to use it. Additionally, refactor _scsih_fw_event_cleanup_queue() such that it no longer iterates over the list without holding the lock, since _firmware_event_work() concurrentl

答复: Re: [Patch] scsi_error: should not get sense for timeout IO in scsi error handler

2015-07-31 Thread jiang . biao2
linux-scsi-ow...@vger.kernel.org wrote on 2015/07/31 21:17:33: > Hannes Reinecke > 发件人: linux-scsi-ow...@vger.kernel.org > > 2015/07/31 21:17 > > 收件人 > > jiang.bi...@zte.com.cn, linux-scsi@vger.kernel.org, jbottom...@odin.com, > > 抄送 > > 主题 > > Re: [Patch] scsi_error: should not get sen

[Patch] qla2xxx: shoud ensure no *io done* after qla2xxx_eh_abort returning SUCCESS to avoid race between *io timeout* and *io done*.

2015-07-31 Thread jiang . biao2
qla2xxx: shoud ensure no *io done* after qla2xxx_eh_abort returning SUCCESS to avoid race between *io timeout* and *io done*. LLDD driver should ensure that there is no *io done* after eh_abort (*qla2xxx_eh_abort*) returning SUCCESS to avoid the race between *io timeout* and *io done*. But qla2xxx

Re: blk-mq vs kmemleak

2015-07-31 Thread Bart Van Assche
On 07/08/2015 01:17 AM, Christoph Hellwig wrote: On Tue, Jul 07, 2015 at 06:59:37AM -0700, Bart Van Assche wrote: Please note that my test was run with CONFIG_SLUB_DEBUG=y which causes a red zone to be allocated before and after each block of allocated memory. Could that explain the kmalloc-96 o

[PATCH 1/3] IB/srp: Constify a function argument

2015-07-31 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Cc: Christoph Hellwig --- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/driv

[PATCH 3/3] IB/srp: Bump driver version and release date

2015-07-31 Thread Bart Van Assche
Since version 1.0 e.g. scsi-mq has been added. Since this is a significant change, bump the driver version and release date. Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Cc: Christoph Hellwig --- drivers/infiniband/ulp/srp/ib_srp.c | 4 ++-- 1 file changed, 2 inse

[PATCH 2/3] IB/srp: Handle partial connection success correctly

2015-07-31 Thread Bart Van Assche
Avoid that the following kernel warning is reported if the SRP target system accepts fewer channels per connection than what was requested by the initiator system: WARNING: at drivers/infiniband/ulp/srp/ib_srp.c:617 srp_destroy_qp+0xb1/0x120 [ib_srp]() Call Trace: [] warn_slowpath_common+0x7f/0xc

[PATCH 0/3] IB/srp patches for Linux kernel v4.3

2015-07-31 Thread Bart Van Assche
Hello Doug, Please apply the following three patches at your earliest convenience: 0001-IB-srp-Constify-a-function-argument.patch 0002-IB-srp-Handle-partial-connection-success-correctly.patch 0003-IB-srp-Bump-driver-version-and-release-date.patch Thanks, Bart. -- To unsubscribe from this list:

[PATCH] lpfc: fix double free on mp

2015-07-31 Thread Colin King
From: Colin Ian King The error path when the call to lpfc_sli_issue_mbox returns MBX_NOT_FINISHED results in the code freeing mp and calling lpfc_mbuf_free twice. Fix this by jumping to the correct part of the error clean up path. Signed-off-by: Colin Ian King --- drivers/scsi/lpfc/lpfc_mbox

Re: [PATCH] scsi: Fixup fixed sense generation

2015-07-31 Thread Bart Van Assche
On 07/31/15 06:05, Hannes Reinecke wrote: Fixed sense reserves only 32 bits for the 'information' field, so we need to restrict the 'information' value to avoid sense data corruption. Also the sense key is only 4 bits. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_error.c | 10 +++-

[PATCH 4/8] sd: Implement new RESET_WP provisioning mode

2015-07-31 Thread Hannes Reinecke
We can map the RESET WRITE POINTER command onto a 'discard' request. Signed-off-by: Hannes Reinecke --- drivers/scsi/sd.c | 56 ++- drivers/scsi/sd.h | 1 + 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/sd.c b/dr

[PATCH 5/8] block: Implement support for zoned block devices

2015-07-31 Thread Hannes Reinecke
Implement a RB-Tree holding the zone information and add support functions for maintaining the RB-Tree. Signed-off-by: Hannes Reinecke --- block/Kconfig | 9 +++ block/Makefile | 1 + block/blk-core.c | 5 block/blk-zoned.c | 70 +++

[PATCH 8/8] sd: Implement support for ZBC devices

2015-07-31 Thread Hannes Reinecke
Implement ZBC support functions to read in the zone information and setup the zone tree. Signed-off-by: Hannes Reinecke --- drivers/scsi/Kconfig | 8 ++ drivers/scsi/Makefile | 1 + drivers/scsi/sd.c | 125 ++-- drivers/scsi/sd.h | 34 + drivers/scsi/sd_zbc.c | 390

[RFC PATCH 0/8] ZBC host-managed device support

2015-07-31 Thread Hannes Reinecke
Hi all, Here is a first stab at supporting ZBC host-managed devices. For the uninitiated: ZBC host-managed devices (aka shingled or SMR drives) have partitioned the drive into several zones, most of which require sequential writes. To handle this the patchset implements a rbtree for the zone infor

[PATCH 7/8] block: Introduce BLKPREP_DONE

2015-07-31 Thread Hannes Reinecke
Add a new blkprep return code BLKPREP_DONE to signal completion without I/O error. Signed-off-by: Hannes Reinecke --- block/blk-core.c| 8 drivers/scsi/scsi_lib.c | 3 ++- include/linux/blkdev.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/block/blk-cor

[PATCH 6/8] block: Add 'zoned' sysfs queue attribute

2015-07-31 Thread Hannes Reinecke
Add a sysfs queue attribute 'zoned' to display the zone layout for zoned devices. Signed-off-by: Hannes Reinecke --- block/blk-sysfs.c | 47 +++ 1 file changed, 47 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index e419f1f..5e2ba53

[PATCH 3/8] sd: Set chunk_sectors to zone size

2015-07-31 Thread Hannes Reinecke
For ZBC devices I/O must not cross zone boundaries, so setup the 'chunk_sectors' block queue setting to the zone size. This is only valid for REPORT ZONES SAME type 2 or 3; for other types the zone sizes might be different for individual zones. So issue a warning if the type is found to be differen

[PATCH 1/8] blk-sysfs: Add 'chunk_sectors' to sysfs attributes

2015-07-31 Thread Hannes Reinecke
The queue limits already have a 'chunk_sectors' setting, so we should be presenting it via sysfs. Signed-off-by: Hannes Reinecke --- block/blk-sysfs.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 6264b38..e419f1f 100

[PATCH 2/8] block: update chunk_sectors in blk_stack_limits()

2015-07-31 Thread Hannes Reinecke
Signed-off-by: Hannes Reinecke --- block/blk-settings.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-settings.c b/block/blk-settings.c index 12600bf..63aa067 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -647,6 +647,9 @@ int blk_stack_limits(struct queue_limi

[PATCH 0/2] scsi_trace updates for ZBC

2015-07-31 Thread Hannes Reinecke
Hi all, here are two small patches for updating scsi_trace to handle ZBC IN and ZBC OUT correctly. They are based on my earlier patchset libata: ZAC host-aware device support As usual, comments and reviews are welcome. Hannes Reinecke (2): scsi-trace: remove service action definitions scsi-t

[PATCH 2/2] scsi-trace: define ZBC_IN and ZBC_OUT

2015-07-31 Thread Hannes Reinecke
Add new trace functions for ZBC_IN and ZBC_OUT. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_trace.c | 87 + include/trace/events/scsi.h | 2 ++ 2 files changed, 89 insertions(+) diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_tr

[PATCH 1/2] scsi-trace: remove service action definitions

2015-07-31 Thread Hannes Reinecke
scsi_opcode_name() is displaying the opcode, not the service action. Signed-off-by: Hannes Reinecke --- include/trace/events/scsi.h | 4 1 file changed, 4 deletions(-) diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index 079bd10..5c0d91f 100644 --- a/include/trace/e

Re: [Patch] scsi_error: should not get sense for timeout IO in scsi error handler

2015-07-31 Thread Hannes Reinecke
On 07/31/2015 11:52 AM, jiang.bi...@zte.com.cn wrote: > scsi_error: should not get sense for timeout IO in scsi error handler > > When an IO timeout occurs, the IO will be aborted in > scsi_abort_command() and SCSI_EH_ABORT_SCHEDULED will be set. Because > of that, the SCSI_EH_CANCEL_CMD will be c

[PATCH] scsi: Fixup fixed sense generation

2015-07-31 Thread Hannes Reinecke
Fixed sense reserves only 32 bits for the 'information' field, so we need to restrict the 'information' value to avoid sense data corruption. Also the sense key is only 4 bits. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_error.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deleti

[PATCH 4/6] libata: Implement ZBC OUT translation

2015-07-31 Thread Hannes Reinecke
ZAC drives implement a 'zac management out' command template, which maps onto the ZBC OUT command. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-eh.c | 1 + drivers/ata/libata-scsi.c | 65 +++ include/linux/ata.h | 7 + in

[PATCH 1/6] libata: Do not retry commands with valid autosense

2015-07-31 Thread Hannes Reinecke
If a failed command has a valid autosense there is no need to retry it on the ATA level; at best we're incurring the same error again. So rather not retry it here, but leave it to the SCSI layer to decide if a retry is in order. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-eh.c | 2 ++

[PATCH 3/6] libata: implement ZBC IN translation

2015-07-31 Thread Hannes Reinecke
ZAC drives implement 'zac management in' command template, which maps onto the ZBC IN command. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-eh.c | 1 + drivers/ata/libata-scsi.c | 141 ++ include/linux/ata.h | 4 ++ include

[PATCH 6/6] libata: support host-aware ZAC devices

2015-07-31 Thread Hannes Reinecke
Byte 69 bits 0:1 in the IDENTIFY DEVICE data indicate a host-aware ZAC device. And whenever we detect a ZAC-compatible device we should be displaying the zoned block characteristics VPD page. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-core.c | 50 ++

[PATCH 0/6] ZAC host-aware device support

2015-07-31 Thread Hannes Reinecke
Hi all, here is a patchset for adding ZAC host-aware device support to libata. Main bits are translations for ZBC IN and ZBC OUT; others are the required plumbing like generating the correct VPD pages. James, do you require a separate patch for adding ZBC IN and ZBC OUT or is it okay to have it qu

[PATCH 2/6] libata-scsi: use ata_scsi_set_sense when generating ATA sense

2015-07-31 Thread Hannes Reinecke
When generating ATA sense we should be using 'ata_scsi_set_sense' and avoid the hand-crafted functions. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-scsi.c | 41 - 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/drivers/ata/libata-s

[PATCH 5/6] libata: support device-managed ZAC devices

2015-07-31 Thread Hannes Reinecke
Device-managed ZAC devices just set the zoned capabilities field in INQUIRY byte 69 (cf ACS-4). This corresponds to the 'zoned' field in the block device characteristics VPD page. As this is only defined in SPC-5/SBC-4 we also need to update the supported SCSI version descriptor. Signed-off-by: Ha

Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-31 Thread Stefano Stabellini
On Tue, 28 Jul 2015, Julien Grall wrote: > Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN > is meant, I suspect this is because the first support for Xen was for > PV. This brough some misimplementation of helpers on ARM and make the > developper confused the expected behavio

[Patch] scsi_error: should not get sense for timeout IO in scsi error handler

2015-07-31 Thread jiang . biao2
scsi_error: should not get sense for timeout IO in scsi error handler When an IO timeout occurs, the IO will be aborted in scsi_abort_command() and SCSI_EH_ABORT_SCHEDULED will be set. Because of that, the SCSI_EH_CANCEL_CMD will be clear in scsi_eh_scmd_add(). So when scsi error handler starts, i

[PATCH 11/15] drivers: target: Drop unlikely before IS_ERR(_OR_NULL)

2015-07-31 Thread Viresh Kumar
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it. Signed-off-by: Viresh Kumar --- drivers/target/tcm_fc/tfc_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/driv