Re: [PATCH 1/2] sg: factor out sg_fill_request_table()

2017-09-15 Thread Douglas Gilbert
On 2017-09-15 08:05 AM, Hannes Reinecke wrote: Factor our sg_fill_request_table() for better readability. Signed-off-by: Hannes Reinecke <h...@suse.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. --- drivers/sc

Re: [PATCH 2/2] sg: fixup infoleak when using SG_GET_REQUEST_TABLE

2017-09-15 Thread Douglas Gilbert
t;h...@suse.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. --- drivers/scsi/sg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index f1e20ca0..7f98ab4 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg

Re: [PATCH] scsi: sg: off by one in sg_ioctl()

2017-08-22 Thread Douglas Gilbert
er <dan.carpen...@oracle.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index d7ff71e0c85c..84e782d8e7c3 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1021,7 +1021,7 @@ sg_ioctl(struct fil

Re: [PATCH] sg: protect against races between mmap() and SG_SET_RESERVED_SIZE

2017-08-22 Thread Douglas Gilbert
er changes to the reserved buffer size as an atomic operation with the mapping. Signed-off-by: Todd Poynor <toddpoy...@google.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. --- drivers/scsi/sg.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git

Re: [PATCH] sg: recheck MMAP_IO request length with lock held

2017-08-22 Thread Douglas Gilbert
he request is linked to the reserve buffer. An -ENOMEM should be returned in this case, instead of switching over to an indirect buffer as for non-MMAP_IO requests. Signed-off-by: Todd Poynor <toddpoy...@google.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. --- driver

Re: [REGRESSION] 28676d869bbb (scsi: sg: check for valid direction before starting the request) breaks mtx tape library control

2017-07-25 Thread Douglas Gilbert
On 2017-07-19 04:36 AM, Johannes Thumshirn wrote: On Wed, Jul 19, 2017 at 03:13:34AM -0500, Jason L Tibbitts III wrote: [ 46.304530] sg_is_valid_dxfer: dxfer_direction: -2, dxfer_len: 0 Ahh now I see the -2 (SG_DXFER_TO_DEV) is the crucial point here. It is 0 in your case. This would "fix"

Re: [PATCH v2] scsi: sg: fix SG_DXFER_FROM_DEV transfers

2017-07-11 Thread Douglas Gilbert
on <chris2...@googlemail.com> Cc: Douglas Gilbert <dgilb...@interlog.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> --- Changes to v1: * Fix breakage of the sg_io v3 interface, verified using sg_inq drivers/scsi/sg.c

Re: [PATCH] scsi: sg: fix SG_DXFER_FROM_DEV transfers

2017-07-06 Thread Douglas Gilbert
On 2017-07-05 09:49 AM, Johannes Thumshirn wrote: SG_DXFER_FROM_DEV transfers do not have a dxferp as we set it to NULL, but must have a length bigger than 0. This fixes a regression introduced by commit 28676d869bbb ("scsi: sg: check for valid direction before starting the request") It is not

Re: [PATCH v2] scsi: sg: don't return bogus Sg_requests

2017-05-10 Thread Douglas Gilbert
ard against other readers */ - break; + write_unlock_irqrestore(>rq_list_lock, iflags); + return resp; } } write_unlock_irqrestore(>rq_list_lock, iflags); - return resp; + return NULL; } /* always adds to end of list */ Acked-by: Douglas Gilbert <dgilb...@interlog.com>

Re: [patch] check length passed to SG_NEXT_CMD_LEN

2017-03-16 Thread Douglas Gilbert
On 2017-03-15 07:38 PM, Martin K. Petersen wrote: Peter Chang <d...@google.com> writes: now that i think i've got gmail not marking everything as spam... Doug? The extra sanity check can't hurt. Acked-by: Douglas Gilbert <dgilb...@interlog.com&

Re: SG does not ignore dxferp (direct io + mmap)

2016-11-21 Thread Douglas Gilbert
ange I see is: commit 5ecee0a3ee8d74b6950cb41e8989b0c2174568d4 Author: Douglas Gilbert <dgilb...@interlog.com> Date: Thu Mar 3 00:31:29 2016 -0500 sg: fix dxferp in from_to case However the kernel I used has that change, and the change purposely does not clear hp->dxferp if SG_DXFER_TO_FR

Re: [PATCH 1/2] scsi: sg: Avoid overflow when USER_HZ > HZ

2016-08-26 Thread Douglas Gilbert
ime constant the 64 bit arithmetic should have no runtime cost. Signed-off-by: Paul Burton <paul.bur...@imgtec.com> That macro has been changed several times, hopefully this is the final time. Acked by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/sg.c | 5 +++-- 1

Re: [PATCH 2/2] scsi: sg: Use mult_frac, drop MULDIV macro

2016-08-26 Thread Douglas Gilbert
e last one :-) As far as I can determine mult_frac() is a cleaner version of MULDIV(); so Acked by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/sg.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg

Re: [PATCH v2] scsi_debug: fix sleep in invalid context

2016-06-08 Thread Douglas Gilbert
On 2016-06-08 04:57 PM, Douglas Gilbert wrote: On 2016-06-07 09:55 PM, Christoph Hellwig wrote: +static int p_fill_from_dev_buffer(struct scsi_cmnd *scp, const void *arr, + int arr_len, unsigned int off_dst) +{ +int act_len, n; +struct scsi_data_buffer *sdb = scsi_in

Re: [PATCH v2] scsi_debug: fix sleep in invalid context

2016-06-08 Thread Douglas Gilbert
On 2016-06-07 09:55 PM, Christoph Hellwig wrote: +static int p_fill_from_dev_buffer(struct scsi_cmnd *scp, const void *arr, + int arr_len, unsigned int off_dst) +{ + int act_len, n; + struct scsi_data_buffer *sdb = scsi_in(scp); + off_t skip =

[PATCH v2] scsi_debug: fix sleep in invalid context

2016-05-31 Thread Douglas Gilbert
) and potentially multiple calls to sg_pcopy_from_buffer() to construct the 'data-in' buffer for the SCSI REPORT LUNS command. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 93 +-- 1 file changed, 66 inse

Re: [PATCH] scsi_debug: fix sleep in invalid context

2016-05-31 Thread Douglas Gilbert
On 2016-05-30 03:09 PM, Christoph Hellwig wrote: On Mon, May 30, 2016 at 12:02:45PM -0700, James Bottomley wrote: This might fix the immediate warning, but won't it demand huge contiguous memory chunks in high lun configurations and thus fail randomly? Report luns is important to us because if

[PATCH] scsi_debug: fix sleep in invalid context

2016-05-30 Thread Douglas Gilbert
memory allocation for response to REPORT LUNS command. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 0f9ba41..b85c5dc

Re: [PATCH v3 3/6] scsi_debug: add multiple queue support

2016-05-09 Thread Douglas Gilbert
On 2016-05-09 06:12 PM, Bart Van Assche wrote: On 05/05/2016 09:40 PM, Douglas Gilbert wrote: static bool stop_queued_cmnd(struct scsi_cmnd *cmnd) { unsigned long iflags; -int k, qmax, r_qmax; +int j, k, qmax, r_qmax; +struct sdebug_queue *sqp; struct

[PATCH v3 5/6] scsi_debug: uuid for lu name

2016-05-05 Thread Douglas Gilbert
m> Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 61 +++ 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index afbbfaa..efb4549 100644

[PATCH v3 6/6] scsi_debug: use locally assigned naa

2016-05-05 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi

[PATCH v3 4/6] scsi_debug: vpd and mode page work

2016-05-05 Thread Douglas Gilbert
; Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 187 ++ 1 file changed, 108 insertions(+), 79 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2ee55d5..afbbfaa 100644 --- a/drivers

[PATCH v3 2/6] scsi_debug: rework resp_report_luns

2016-05-05 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 135 +-

[PATCH v3 0/6] scsi_debug: multiple queue support and cleanup

2016-05-05 Thread Douglas Gilbert
half.patch Douglas Gilbert (6): scsi_debug: use pdt constants scsi_debug: rework resp_report_luns scsi_debug: add multiple queue support scsi_debug: vpd and mode page work scsi_debug: uuid for lu name scsi_debug: use locally assigned naa drivers/scsi/scsi_debu

[PATCH v3 1/6] scsi_debug: use pdt constants

2016-05-05 Thread Douglas Gilbert
Use TYPE_* constants for SCSI peripheral device types instead of numbers. Further cleanups requested by checkpatch.pl . Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Signed-off-by: Douglas Gilbert <dgilb...@interlog.com>

[PATCH v3 3/6] scsi_debug: add multiple queue support

2016-05-05 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default off. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-05-05 Thread Douglas Gilbert
On 2016-05-04 06:32 PM, Bart Van Assche wrote: On 04/30/2016 07:44 PM, Douglas Gilbert wrote: +static struct sdebug_queue *get_queue(void) +{ +struct sdebug_queue *sqp = sdebug_q_arr; + +return sqp + (raw_smp_processor_id() % submit_queues); +} Does this function have the same purpose

Re: [PATCH 2/3] libata-scsi: Fix SCSI INQUIRY version descriptor

2016-05-03 Thread Douglas Gilbert
On 2016-05-02 04:13 PM, tom.t...@gmail.com wrote: From: Tom Yan https://bugzilla.kernel.org/show_bug.cgi?id=106931 Signed-off-by: Tom Yan diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index cd30f11..0295c38 100644 ---

Re: [PATCH v2.5 4/6] scsi_debug: vpd and mode page work

2016-05-02 Thread Douglas Gilbert
On 2016-05-02 04:38 AM, Hannes Reinecke wrote: On 05/01/2016 04:44 AM, Douglas Gilbert wrote: Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas

Re: [PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-05-02 Thread Douglas Gilbert
On 2016-05-02 04:35 AM, Hannes Reinecke wrote: On 05/01/2016 04:44 AM, Douglas Gilbert wrote: Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which

[PATCH v2.5 4/6] scsi_debug: vpd and mode page work

2016-04-30 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c

[PATCH v2.5 5/6] scsi_debug: uuid for lu name

2016-04-30 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.

[PATCH v2.5 6/6] scsi_debug: use locally assigned naa

2016-04-30 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/d

[PATCH v2.5 2/6] scsi_debug: rework resp_report_luns

2016-04-30 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 135 +- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/sc

[PATCH v2.5 3/6] scsi_debug: add multiple queue support

2016-04-30 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

[PATCH v2.5 0/6] scsi_debug: rebase second half of series

2016-04-30 Thread Douglas Gilbert
of this series (1 through 7) have already been applied to the maintainers' trees. That differed slightly from my v2 series (after 7/12 was applied). So 1/6 of this series is a resync and the next 5 patches in this series correspond to v2 8/12 through 12/12 (give or take a little fuzz). Douglas Gilbert

[PATCH v2.5 1/6] scsi_debug: use pdt constants

2016-04-30 Thread Douglas Gilbert
Use TYPE_* constants for SCSI peripheral device types instead of numbers. Further cleanups requested by checkpatch.pl . Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 86 +-- 1 file changed, 45 insertions(

Re: [PATCH 00/12] scsi_debug: multiple queue support and cleanup

2016-04-29 Thread Douglas Gilbert
On 2016-04-29 07:53 PM, Martin K. Petersen wrote: "Doug" == Douglas Gilbert <dgilb...@interlog.com> writes: Doug> Primary reason for this patch series is to add multi queue support Doug> modelled on the null_blk driver. Ignore host_lock option but keep Doug&g

[PATCH v2 07/12] scsi_debug: use likely hints on fast path

2016-04-29 Thread Douglas Gilbert
at point of invocation. Introduce bool have_dif_prot to make clear when T10 protection ("dif") is active. Only print host protection summary at driver startup if there is either "dif" or "dix" to report. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com>

[PATCH v2 08/12] scsi_debug: rework resp_report_luns

2016-04-29 Thread Douglas Gilbert
allocation allowing up to 256 normal LUNs per target. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 135 +- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/sc

[PATCH v2 09/12] scsi_debug: add multiple queue support

2016-04-29 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

[PATCH v2 11/12] scsi_debug: uuid for lu name

2016-04-29 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to have the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.

[PATCH v2 12/12] scsi_debug: use locally assigned naa

2016-04-29 Thread Douglas Gilbert
For reported SAS addresses replace fake IEEE registered NAAs (5) with locally assigned NAAs (3). Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/d

[PATCH v2 06/12] scsi_debug: re-order file scope declarations

2016-04-29 Thread Douglas Gilbert
Group most defines together first; followed by struct definitions and then table and variable definitions. Normalize all function headers. Replace dummy DEV_READONLY(tgt) macro with comment. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c

[PATCH v2 10/12] scsi_debug: vpd and mode page work

2016-04-29 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c

[PATCH v2 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-29 Thread Douglas Gilbert
Shorten file scope static and constant names. Use more get/put_unaligned calls to hide bit banging. Introduce sdebug_verbose boolean to replace frequent masking of option bit flags. Add GPL and bump version. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

[PATCH v2 04/12] scsi_debug: make jiffy delay name clearer

2016-04-29 Thread Douglas Gilbert
Add 'j' to delay names to make it clearer that its unit is jiffies and to differentiate it from sdebug_ndelay whose unit is nanoseconds. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 46 +++--- 1 file chang

[PATCH v2 02/12] scsi_debug: ignore host lock option

2016-04-29 Thread Douglas Gilbert
Remove logic to optionally hold host_lock while each command is queued. Keep module and sysfs host_lock parameters for backward compatibility. Note in module parameter description that host_lock is ignored. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.

[PATCH v2 00/12] scsi_debug: multiple queue support and cleanup

2016-04-29 Thread Douglas Gilbert
both the jiffy and nanosecond delay parameters. Replace the tasklets with work items. Incorporate REPORT LUNS patch from Tomas Winkler sent in Febrary 2015. Add parameter that permits LU names to use UUIDs (spc5r08.pdf). Douglas Gilbert (12): scsi_debug: cleanup naming and bit crunching

[PATCH v2 03/12] scsi_debug: replace jiffy timers with hr timers

2016-04-29 Thread Douglas Gilbert
-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 54 +-- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 40aaaed..c3f3a84 100644 --- a/driver

[PATCH v2 05/12] scsi_debug: replace tasklet with work queue

2016-04-29 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 228 +++--- 1 file changed, 95 insertions(+), 133 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2a50e9d..35c1ed3 100644 --- a/d

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 06:14 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: -if ((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && -(lba <= (OPT_MEDIUM_ERR_ADDR + OPT_MEDIUM_ERR_NUM - 1)) && -((lba + num) > OPT_MEDIUM_ERR_

Re: [PATCH 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 02:13 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: @@ -580,8 +580,8 @@ static int sdebug_sectors_per;/* sectors per cylinder */ static unsigned int scsi_debug_lbp(void) { -return ((0 == scsi_debug_fake_rw) && -(scsi_de

Re: [PATCH 08/12] scsi_debug: rework resp_report_luns

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 02:26 AM, Hannes Reinecke wrote: On 04/25/2016 06:16 PM, Douglas Gilbert wrote: Based on "[PATH V2] scsi_debug: rework resp_report_luns" patch sent by Tomas Winkler on Thursday, 26 Feb 2015. His notes: 1. Remove duplicated boundary checks which simplify the fill-in

[PATCH 03/12] scsi_debug: replace jiffy timers with hr timers

2016-04-25 Thread Douglas Gilbert
-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 56 ++- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 42e5c37..9dc0349 100644 --- a/driver

[PATCH 08/12] scsi_debug: rework resp_report_luns

2016-04-25 Thread Douglas Gilbert
allocation allowing up to 16383 LUNs per target. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 138 ++ 1 file changed, 91 insertions(+), 47 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/sc

[PATCH 10/12] scsi_debug: vpd and mode page work

2016-04-25 Thread Douglas Gilbert
Cleanup some mode and vpd pages. Stop reporting SBC (disk) pages when peripheral type is something else (e.g. tape). Update version descriptors. Expand LBPRZ flag handling. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c

[PATCH 12/12] scsi_debug: use locally assigned naa

2016-04-25 Thread Douglas Gilbert
Change NAA addresses used for SAS addresses from fake IEEE registered NAA (5) to locally assigned NAA (3). Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff

[PATCH 09/12] scsi_debug: add multiple queue support

2016-04-25 Thread Douglas Gilbert
Add submit_queue parameter (minimum and default: 1; maximum: nr_cpu_ids) that controls how many queues are built, each with their own lock and in_use bit vector. Add statistics parameter which is default on. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

[PATCH 11/12] scsi_debug: uuid for lu name

2016-04-25 Thread Douglas Gilbert
(storage device) name. Additional option for all LU names to be the same UUID (since their storage is shared). Previous action of using NAA identifier for LU name remains the default. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.

[PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-25 Thread Douglas Gilbert
The most common commands in normal use are the READ and WRITE SCSI commands. Use likely and unlikely hints along the path taken by these commands. Rename check_readiness() to make_ua() and remove associated dead code. Rename devInfoReg() to find_build_dev_info(). Signed-off-by: Douglas Gilbert

[PATCH 06/12] scsi_debug: re-order file scope declarations

2016-04-25 Thread Douglas Gilbert
Group most defines together first; followed by struct definitions and then table and variable definitions. Normalize all function headers. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 314 ++ 1 file c

[PATCH 00/12] scsi_debug: multiple queue support and cleanup

2016-04-25 Thread Douglas Gilbert
. Incorporate REPORT LUNS patch from Tomas Winkler sent in Febrary 2015. Add parameter that permits LU names to use UUIDs (spc5r08.pdf). Douglas Gilbert (12): scsi_debug: cleanup naming and bit crunching scsi_debug: ignore host lock option scsi_debug: replace jiffy timers with hr timers

[PATCH 04/12] scsi_debug: make jiffy delay name clearer

2016-04-25 Thread Douglas Gilbert
Add 'j' to delay names to make it clearer that its unit is jiffies and to differentiate it from sdebug_ndelay whose unit is nanoseconds. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 46 +++--- 1 file chang

[PATCH 02/12] scsi_debug: ignore host lock option

2016-04-25 Thread Douglas Gilbert
Remove logic to optionally hold host_lock while each command is queued. Keep module and sysfs host_lock parameters for backward compatibility. Note in module parameter description that host_lock is ignored. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.

[PATCH 05/12] scsi_debug: replace tasklet with work queue

2016-04-25 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 230 +++--- 1 file changed, 95 insertions(+), 135 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5ad16e6..8ee9df6 100644 --- a/d

[PATCH 01/12] scsi_debug: cleanup naming and bit crunching

2016-04-25 Thread Douglas Gilbert
Shorten file scope static and constant names. Use more get/put_unaligned calls to hide bit banging. Introduce sdebug_verbose boolean to replace frequent masking of option bit flags. Add GPL and bump version. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_d

Re: [PATCH] SCSI: LIBSCSI: Fixed codeing style errors

2016-04-20 Thread Douglas Gilbert
On 16-04-20 03:51 AM, Bob Stlt wrote: Fixed codeing style formatting errors. Signed-off-by: Bob Stlt --- drivers/scsi/libiscsi.c | 90 - 1 file changed, 45 insertions(+), 45 deletions(-) diff --git

EXPORT_SYMBOL(scsi_use_blk_mq);

2016-04-16 Thread Douglas Gilbert
Is there a good reason why 'bool scsi_use_blk_mq' declared as extern in scsi_hosts.h is not an exported symbol? That would allow a LLD loaded as a module to access it. Doug Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to

Re: [Lsf] LSF/MM Schedule and improving discard support

2016-04-13 Thread Douglas Gilbert
On 16-04-13 01:30 PM, Darrick J. Wong wrote: On Wed, Apr 13, 2016 at 09:51:04AM -0700, James Bottomley wrote: On Wed, 2016-04-13 at 09:29 -0700, Bart Van Assche wrote: On 04/13/2016 09:21 AM, Martin K. Petersen wrote: From a filesystem/ioctl perspective, BLKDISCARD is a hint. We should not

Re: [Bug 115351] New: redundant pointless messages

2016-03-27 Thread Douglas Gilbert
On 16-03-27 03:48 PM, bugzilla-dae...@bugzilla.kernel.org wrote: https://bugzilla.kernel.org/show_bug.cgi?id=115351 Bug ID: 115351 Summary: redundant pointless messages Product: IO/Storage Version: 2.5 Kernel Version: All

Re: [PATCHv2 3/3] scsi-trace: define ZBC_IN and ZBC_OUT

2016-03-24 Thread Douglas Gilbert
ing the opcode/service actions from zbc-r05.pdf: CLOSE ZONE 94h/01h FINISH ZONE 94h/02h OPEN ZONE 94h/03h REPORT ZONES 95h/00h RESET WRITE POINTER 94h/04h +#define ZO_FINISH_ZONE 0x03 s/0x03/0x02/ Thereafter: Reviewed-by: Douglas Gilbert <d

Re: [PATCH] scsi: vpd pages are mandatory for SPC-2

2016-03-15 Thread Douglas Gilbert
On 16-03-15 08:42 AM, Christoph Hellwig wrote: On Tue, Mar 15, 2016 at 08:28:42AM +0100, Hannes Reinecke wrote: But it feels even sillier having to whitelist every standards-conformant device here; I certainly was when I figured that EMC Clariion won't work properly without this patch. And the

[PATCH] sg: fix dxferp in from_to case

2016-03-02 Thread Douglas Gilbert
given. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 5e82067..ae7d9bd 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -652,7 +652,8 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)

[ANNOUNCE] sdparm 1.10 available

2016-02-23 Thread Douglas Gilbert
sdparm is a command line utility designed to get and set SCSI device parameters (cf hdparm for ATA disks). The parameters are held in mode pages. Apart from SCSI devices (e.g. disks, tapes and enclosures) sdparm can be used on any device that uses a SCSI command set. sdparm also can decode VPD

Re: [Announce] sg3_utils-1.42 available

2016-02-18 Thread Douglas Gilbert
On 16-02-17 11:59 PM, Douglas Gilbert wrote: sg3_utils is a package of command line utilities for sending SCSI and some ATA commands to devices. This package targets the Linux 4, 3, 2.6 and 2.4 kernel series. It has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and MinGW). There are two

[Announce] sg3_utils-1.42 available

2016-02-17 Thread Douglas Gilbert
sg3_utils is a package of command line utilities for sending SCSI and some ATA commands to devices. This package targets the Linux 4, 3, 2.6 and 2.4 kernel series. It has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and MinGW). There are two new utilities (sg_read_attr and sg_timestamp)

Re: [PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Douglas Gilbert
On 16-02-12 03:39 AM, Hannes Reinecke wrote: Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for current->mm to see if we have a user space context and only copies data if we do. Now if an IO gets interrupted by a signal data isn't copied into user space any more (as we don't

T10 adds locally assigned UUID designation descriptor

2016-02-08 Thread Douglas Gilbert
Recently, in draft spc5r08, T10 added a locally assigned RFC 4122 UUID *** designation descriptor. That descriptor can now be returned for VPD page 0x83 (device identification) amongst others. It can be used anywhere SCSI needs a unique identifier expanding the previous set of preferred

Re: T10 adds locally assigned UUID designation descriptor

2016-02-08 Thread Douglas Gilbert
On 16-02-08 02:00 PM, James Bottomley wrote: On Mon, 2016-02-08 at 12:33 -0500, Douglas Gilbert wrote: Recently, in draft spc5r08, T10 added a locally assigned RFC 4122 UUID *** designation descriptor. That descriptor can now be returned for VPD page 0x83 (device identification) amongst others

Re: What partition should the MTMKPART argument specify? Was: Re: st driver doesn't seem to grok LTO partitioning

2016-02-04 Thread Douglas Gilbert
: 11 0a 01 01 3c 03 09 00 ff ff 00 0a [st0] Sending FORMAT MEDIUM [st0] Rewinding tape. # sg_read_attr -s 3 /dev/sg1 Partition number list: First partition number: 0 Number of partitions available: 2 Looks good. Tested-by: Douglas Gilbert <dgilb...@interlog.com> On 16-02-04 12:54 PM

Re: st driver doesn't seem to grok LTO partitioning

2016-01-22 Thread Douglas Gilbert
Laurence, Shane Seymour from HP provided this useful link: https://docs.oracle.com/cd/E21419_04/en/LTO5_Vol3_E5b/LTO5_Vol3_E5b.pdf That documents the WRITE BUFFER command on pages 228 and 229 used by HP LTO-5 drives. For sending new firmware it looks like you need to use MODE 4 or 5. [That

Re: st driver doesn't seem to grok LTO partitioning

2016-01-06 Thread Douglas Gilbert
On 16-01-06 10:32 AM, Laurence Oberman wrote: Firmware update fails as follows: Still researching. This is the only LTO5 I have access to so unless Shane has one I may not be able to make progress. (Its way long out of warranty and support) We mostly use this for generic st driver and changer

Re: [PATCH v2 3/3] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-12-22 Thread Douglas Gilbert
-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Tested-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/constants.c | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index

Re: [PATCH v2 1/3] scsi: make some Additional Sense strings more grep'able

2015-12-22 Thread Douglas Gilbert
On 15-11-24 04:42 AM, Rasmus Villemoes wrote: There's little point in breaking these strings over multiple lines. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> Tested-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/constants.c | 27 +--

Re: [PATCH 1/3] scsi_debug: Increase the reported optimal transfer length

2015-12-16 Thread Douglas Gilbert
to 1024 blocks. Signed-off-by: Martin K. Petersen <martin.peter...@oracle.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_d

Re: [PATCH 2/3] sd: Reject optimal transfer length smaller than page size

2015-12-16 Thread Douglas Gilbert
enum blk_default_limits { BLK_MAX_SEGMENTS= 128, BLK_SAFE_MAX_SECTORS= 255, BLK_DEF_MAX_SECTORS = 2560, BLK_MAX_SEGMENT_SIZE= 65536, BLK_SEG_BOUNDARY_MASK = 0xUL, }; Reviewed-by: Douglas Gilbert <dgilb...@interlog.com>

Re: [PATCH 0/15] copy offload patches

2015-12-14 Thread Douglas Gilbert
On 15-12-14 08:22 PM, Mikulas Patocka wrote: On Thu, 10 Dec 2015, Martin K. Petersen wrote: "Mikulas" == Mikulas Patocka writes: Mikulas, Mikulas> This patch series adds copy offload (the XCOPY command) to the Mikulas> block layer, SCSI subsystems and device mapper.

Re: BUG: KASAN: slab-out-of-bounds in ses_enclosure_data_process+0x900/0xe50

2015-12-03 Thread Douglas Gilbert
On 15-12-03 03:59 PM, James Bottomley wrote: On Thu, 2015-12-03 at 21:36 +0100, Andrea Gelmini wrote: On Wed, Dec 02, 2015 at 02:58:21PM -0800, James Bottomley wrote: On Tue, 2015-12-01 at 21:20 +0100, Andrea Gelmini wrote: OK, this looks like some type of problem with a USB enclosure. It's

[PATCH RESEND] scsi_debug: fix prevent_allow+verify regressions

2015-11-22 Thread Douglas Gilbert
commands are accepted and do nothing. ChangeLog: - fix the lk 3.19 regression so that the PREVENT ALLOW MEDIUM REMOVAL command is supported once again - same fix for VERIFY(10) Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- a/drivers/scsi/scsi_debug.c 2015-02-11

Re: [PATCH] sg: Fix double-free when drives detach during SG_IO

2015-11-02 Thread Douglas Gilbert
ject when this happens, we need to free memory backing ->cmd if it isn't embedded in the object itself. KASAN was extremely helpful in finding the root cause of this bug. Signed-off-by: Calvin Owens <calvinow...@fb.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> Thanks. ---

Re: [PATCH v3 3/4] scsi: move all obsolete ioctls to scsi_ioctl.h

2015-09-28 Thread Douglas Gilbert
<bart.vanass...@sandisk.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo i

Re: [PATCH v3 2/4] scsi: cleanup scsi/scsi_ioctl.h

2015-09-28 Thread Douglas Gilbert
an Assche <bart.vanass...@sandisk.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More m

Re: [PATCH v3 1/4] scsi: remove old-style type names from sg.h

2015-09-28 Thread Douglas Gilbert
istoph Hellwig <h...@lst.de> Cc: linux-scsi@vger.kernel.org Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> Acked-by: Douglas Gilbert <dgilb...@interlog.com> -- To unsubscribe from this list: send the line "

[Announce] sg3_utils-1.41 available

2015-07-07 Thread Douglas Gilbert
sg3_utils is a package of command line utilities for sending SCSI and some ATA commands to devices. This package targets the Linux 4, 3, 2.6 and 2.4 kernel series. It has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and MinGW). There is one new utility (sg_zone) and additions to many

Re: how to decode SG_IO: bad/missing sense data?

2015-06-16 Thread Douglas Gilbert
On 15-06-16 01:05 PM, Tom Yan wrote: When I ATA Secure Erase a USB Flash Drive, I got: SG_IO: bad/missing sense data, sb[]: f0 00 01 00 50 40 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 While the erase seems to work without bricking the device (multiple

Re: Has anyone seen this?

2015-04-14 Thread Douglas Gilbert
On 15-04-14 06:52 PM, Sagi Grimberg wrote: When I set up a DIX enabled device for the first time (say scsi_debug) it all works, but when I remove it and set it up again I get the below crash: Reproducer: $modprobe scsi_debug dif=1 dix=1 $modprobe -r scsi_debug $modprobe scsi_debug dif=1 dix=1

[PATCH] scsi_debug: fix prevent_allow+verify regressions

2015-04-06 Thread Douglas Gilbert
- same fix for VERIFY(10) Signed-off-by: Douglas Gilbert dgilb...@interlog.com --- a/drivers/scsi/scsi_debug.c 2015-02-11 17:47:09.276206425 -0500 +++ b/drivers/scsi/scsi_debug.c 2015-04-03 22:42:36.343971372 -0400 @@ -455,8 +455,9 @@ static const struct opcode_info_t opcode 0} }, {0, 0, 0

Re: Suggestions for testing SAS cables via sg3_utils

2015-03-18 Thread Douglas Gilbert
On 15-03-18 03:25 PM, Jeff Johnson wrote: Greetings, Does anyone have an effective way of testing SAS cabling in a Linux environment without using a block storage device? Something like reading/writing to a buffer in an expander (LSI). Something that could stress all four lanes of a multilane

Re: use dedicated storage for scsi_debug LUNs

2015-03-05 Thread Douglas Gilbert
On 15-03-05 10:33 AM, Olaf Hering wrote: I'm using scsi_debug to implement and test tools for xen-scsiback. Today I discovered that each LUN uses the very same storage, as described in the docs. What would it take to optionally use dedicated storage for each LUN? This is how I load scsi_debug:

<    1   2   3   4   5   6   7   8   >