[PATCH] qedf: fix wrong le16 conversion

2017-03-20 Thread Arnd Bergmann
gcc points out that we are converting a 16-bit integer into a 32-bit little-endian type and assigning that to 16-bit little-endian will end up with a zero: drivers/scsi/qedf/drv_fcoe_fw_funcs.c: In function 'init_initiator_rw_fcoe_task': include/uapi/linux/byteorder/big_endian.h:32:26: error: lar

Re: [PATCH] scsi: libsas: fix ata xfer length

2017-03-20 Thread John Garry
On 19/03/2017 17:21, Martin K. Petersen wrote: John Garry writes: John, The total ata xfer length may not be calculated properly, in that we do not use the proper method to get an sg element dma length. According to the code comment, sg_dma_len() should be used after dma_map_sg() is called.

[PATCHv3 0/5] Dynamic growing data area support

2017-03-20 Thread lixiubo
From: Xiubo Li Changed for V3: - [PATCHv2 2/5] fix double usage of blocks and possible page fault call trace. - [PATCHv2 5/5] fix a mistake. Changed for V2: - [PATCHv2 1/5] just fixes some small spelling and other mistakes. And as the initial patch, here sets cmd area to 8M and data area to

[PATCHv3 4/5] target/user: Fix wrongly calculating of the base_command_size

2017-03-20 Thread lixiubo
From: Xiubo Li The t_data_nents and t_bidi_data_nents are all the numbers of the segments, and we couldn't be sure the size of the data area block will equal to size of the segment. Use the actually block number needed intead of the sum of segments. Signed-off-by: Xiubo Li --- drivers/target/

[PATCHv3 2/5] tcmu: Add global data block pool support

2017-03-20 Thread lixiubo
From: Xiubo Li For each target there will be one ring, when the target number grows larger and larger, it could eventually runs out of the system memories. In this patch for each target ring, for the cmd area the size will be limited to 8MB and for the data area the size will be limited to 256K

[PATCHv3 1/5] tcmu: Add dynamic growing data area feature support

2017-03-20 Thread lixiubo
From: Xiubo Li Currently for the TCMU, the ring buffer size is fixed to 64K cmd area + 1M data area, and this will be bottlenecks for high iops. The struct tcmu_cmd_entry {} size is fixed about 112 bytes with iovec[N] & N <= 4, and the size of struct iovec is about 16 bytes. If N == 0, the rati

[PATCHv3 5/5] target/user: Clean up tcmu_queue_cmd_ring

2017-03-20 Thread lixiubo
From: Xiubo Li Add two helpers to simplify the code, and move some code out of the cmdr spin lock to reduce the size of critical region. Signed-off-by: Xiubo Li --- drivers/target/target_core_user.c | 68 +-- 1 file changed, 37 insertions(+), 31 deletions(-)

[PATCHv3 3/5] target/user: Fix possible overwrite of t_data_sg's last iov[]

2017-03-20 Thread lixiubo
From: Xiubo Li If there has BIDI data, its first iov[] will overwrite the last iov[] for se_cmd->t_data_sg. To fix this, we can just increase the iov pointer, but this may introuduce a new memory leakage bug: If the se_cmd->data_length and se_cmd->t_bidi_data_sg->length are all not aligned up to

Re: [PATCH] qedf: fix wrong le16 conversion

2017-03-20 Thread Chad Dupuis
On Mon, 20 Mar 2017, 8:49am -, Arnd Bergmann wrote: > gcc points out that we are converting a 16-bit integer into a 32-bit > little-endian type and assigning that to 16-bit little-endian > will end up with a zero: > > drivers/scsi/qedf/drv_fcoe_fw_funcs.c: In function > 'init_initiator_rw_f

Re: [PATCH] scsi: libsas: fix ata xfer length

2017-03-20 Thread Martin K. Petersen
John Garry writes: > I should have added this originally to the changelog: > Fixes: ff2aeb1eb64c8a4770a6 ("libata: convert to chained sg") Added. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] scsi: sr: fix oob access in get_capabilities

2017-03-20 Thread Martin K. Petersen
Kefeng Wang writes: Kefeng, > The issue still exists, the patch return zero in scsi_mode_sense(), but zero > means > SAM_STAT_GOOD in scsi_status_is_good(), so n will be still bigger than 512; OK, I checked the other users of scsi_mode_sense(). So let's keep this fix local to sr.c for now. Ho

[PATCH] hpsa: fix volume offline state

2017-03-20 Thread Tomas Henzl
In a previous patch a hpsa_scsi_dev_t.volume_offline update line has been removed, so let us put it back.. Fixes: 85b29008d8 (hpsa: update check for logical volume status) Signed-off-by: Tomas Henzl --- drivers/scsi/hpsa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hpsa.c

RE: [PATCH] hpsa: fix volume offline state

2017-03-20 Thread Don Brace
> -Original Message- > From: Tomas Henzl [mailto:the...@redhat.com] > Sent: Monday, March 20, 2017 10:43 AM > To: linux-scsi@vger.kernel.org > Cc: Don Brace ; joseph.szczy...@hpe.com > Subject: [PATCH] hpsa: fix volume offline state > > EXTERNAL EMAIL > > > In a previous patch a hpsa_scs

[PATCH 3/7] libata: remove SCT WRITE SAME support

2017-03-20 Thread Christoph Hellwig
This was already disabled a while ago because it caused I/O errors, and it's severly getting into the way of the discard / write zeroes rework. Signed-off-by: Christoph Hellwig --- drivers/ata/libata-scsi.c | 128 +++--- 1 file changed, 29 insertions(+), 9

[PATCH 2/7] sd: provide a new ata trim provisioning mode

2017-03-20 Thread Christoph Hellwig
This uses a vendor specific command to pass the ATA TRIM payload to libata without having to rewrite it in place. Support for it is indicated by a new flag in struct scsi_device that libata will set in it's slave_configure routine. A second flag indicates if TRIM will reliably zero data. Signed-

[PATCH 6/7] sd: support multi-range TRIM for ATA disks

2017-03-20 Thread Christoph Hellwig
Almost the same scheme as the older multi-range support for NVMe. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cc8684818305..c18fe9ff1

support ranges TRIM for libata

2017-03-20 Thread Christoph Hellwig
This series implements rangeѕ discard for ATA SSDs. Compared to the initial NVMe support there are two things that complicate the ATA support: - ATA only suports 16-bit long ranges - the whole mess of generating a SCSI command first and then translating it to an ATA one. This series adds su

[PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-20 Thread Christoph Hellwig
Split sd_setup_discard_cmnd into one function per provisioning type. While this creates some very slight duplication of boilerplate code it keeps the code modular for additions of new provisioning types, and for reusing the write same functions for the upcoming scsi implementation of the Write Zer

[PATCH 4/7] libata: simplify the trim implementation

2017-03-20 Thread Christoph Hellwig
Don't try to fake up basic SCSI logical block provisioning and WRITE SAME support, but offer support for the Linux Vendor Specific TRIM command instead. This simplifies the implementation a lot, and avoids rewriting the data out buffer in the I/O path. Note that this new command is only offered

[PATCH 5/7] block: add a max_discard_segment_size queue limit

2017-03-20 Thread Christoph Hellwig
ATA only allows 16 bits, so we need a limit. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 6 ++ block/blk-merge.c | 9 + block/blk-settings.c | 14 ++ include/linux/blkdev.h | 8 4 files changed, 37 insertions(+) diff --git a/block/blk

[PATCH 7/7] sd: use ZERO_PAGE for WRITE_SAME payloads

2017-03-20 Thread Christoph Hellwig
We're never touching the contents of the page, so save a memory allocation for these cases. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c18fe9ff1f8f..af632e350ab4 100

Re: [PATCH] scsi: sr: fix oob access in get_capabilities

2017-03-20 Thread Kefeng Wang
On 2017/3/20 22:29, Martin K. Petersen wrote: > Kefeng Wang writes: > > Kefeng, > >> The issue still exists, the patch return zero in scsi_mode_sense(), but zero >> means >> SAM_STAT_GOOD in scsi_status_is_good(), so n will be still bigger than 512; > > OK, I checked the other users of scsi_

Re: [PATCHv3 0/5] Dynamic growing data area support

2017-03-20 Thread Nicholas A. Bellinger
Hi Xiubo ! On Mon, 2017-03-20 at 17:09 +0800, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Changed for V3: > - [PATCHv2 2/5] fix double usage of blocks and possible page fault > call trace. > - [PATCHv2 5/5] fix a mistake. > > Changed for V2: > - [PATCHv2 1/5] just fixes some smal

Re: [PATCHv3 0/5] Dynamic growing data area support

2017-03-20 Thread Xiubo Li
On 2017年03月21日 13:24, Nicholas A. Bellinger wrote: Hi Xiubo ! On Mon, 2017-03-20 at 17:09 +0800, lixi...@cmss.chinamobile.com wrote: From: Xiubo Li Changed for V3: - [PATCHv2 2/5] fix double usage of blocks and possible page fault call trace. - [PATCHv2 5/5] fix a mistake. Changed for V2: