Re: Multi-Actuator SAS HDD First Look

2018-04-09 Thread Douglas Gilbert
On 2018-04-09 02:17 AM, Hannes Reinecke wrote: On 04/09/2018 04:08 AM, Tim Walker wrote: On Fri, Apr 6, 2018 at 11:09 AM, Douglas Gilbert wrote: On 2018-04-06 02:42 AM, Christoph Hellwig wrote: On Fri, Apr 06, 2018 at 08:24:18AM +0200, Hannes Reinecke wrote: Ah. Far better. What about

Re: [PATCH v2] scsi_debug: implement IMMED bit

2018-04-08 Thread Douglas Gilbert
On 2018-04-07 10:23 PM, Ming Lei wrote: On Fri, Feb 09, 2018 at 09:36:39PM -0500, Douglas Gilbert wrote: The Start Stop Unit (SSU) command takes in the order of a second to complete on some SAS SSDs and longer on hard disks. Synchronize Cache (SC) can also take some time. Both commands have an

Re: Multi-Actuator SAS HDD First Look

2018-04-06 Thread Douglas Gilbert
On 2018-04-06 02:42 AM, Christoph Hellwig wrote: On Fri, Apr 06, 2018 at 08:24:18AM +0200, Hannes Reinecke wrote: Ah. Far better. What about delegating FORMAT UNIT to the control LUN, and not implementing it for the individual disk LUNs? That would make an even stronger case for having a control

Re: Multi-Actuator SAS HDD First Look

2018-04-05 Thread Douglas Gilbert
On 2018-04-05 07:43 PM, Tim Walker wrote: On Tue, Apr 3, 2018 at 1:46 AM, Christoph Hellwig wrote: On Sat, Mar 31, 2018 at 01:03:46PM +0200, Hannes Reinecke wrote: Actually I would propose to have a 'management' LUN at LUN0, who could handle all the device-wide commands (eg things like START S

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-04 Thread Douglas Gilbert
On 2018-04-04 04:32 PM, Kees Cook wrote: On Wed, Apr 4, 2018 at 12:07 PM, Oleksandr Natalenko wrote: [ 261.262135] Bad or missing usercopy whitelist? Kernel memory exposure attempt detected from SLUB object 'scsi_sense_cache' (offset 94, size 22)! I can easily reproduce it with a qemu VM and 2

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-04 Thread Douglas Gilbert
On 2018-04-04 04:21 PM, Kees Cook wrote: On Wed, Apr 4, 2018 at 12:07 PM, Oleksandr Natalenko wrote: With v4.16 I get the following dump while using smartctl: [...] [ 261.262135] Bad or missing usercopy whitelist? Kernel memory exposure attempt detected from SLUB object 'scsi_sense_cache' (off

Re: [PATCH v2] Fix DID_OK handling in __scsi_error_from_host_byte()

2018-04-04 Thread Douglas Gilbert
good status values into BLK_STS_OK. Fixes: e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()") Reported-by: Damien Le Moal Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Douglas Gilbert Reviewed-by: Douglas Gilbert Cc: Damien L

[PATCH] scsi: fix __scsi_error_from_host_byte() breakage

2018-04-04 Thread Douglas Gilbert
ent in the driver_byte and the status byte. Add those checks and expand description of function accordingly. Signed-off-by: Douglas Gilbert --- The function would be better called blk_status_from_scsi_result(). Is the leading "__" needed? drivers/scsi/scsi_lib.c | 7 ++- 1 file c

Re: [PATCH] Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"

2018-04-04 Thread Douglas Gilbert
cular rabbit hole. Plus add 'case DID_OK:' before the 'default:' to emphasis the point. Doug Gilbert Fixes: e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()") Reported-by: Damien Le Moal Signed-off-by: Bart Van Ass

Re: [PATCHv2] scsi: Fix failed request error code

2018-04-04 Thread Douglas Gilbert
On 2018-04-04 03:27 AM, Hannes Reinecke wrote: With the introduction of commit e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"), a command that failed with hostbyte=DID_OK and driverbyte=DRIVER_SENSE but lacking additional sense information will have a re

Re: Regarding SCSI SANITIZE command support

2018-04-03 Thread Douglas Gilbert
On 2018-04-02 07:10 AM, Mahesh Rajashekhara wrote: Hello, I am RAID HBA driver engineer here at Microsemi. We are working on linux driver development for Microsemi SAS/SATA RAID HBA controllers. As per our understanding, while a drive is processing the SANITIZE command: - The drive should stil

Re: Multi-Actuator SAS HDD First Look

2018-04-02 Thread Douglas Gilbert
On 2018-04-02 11:34 AM, Tim Walker wrote: On Sat, Mar 31, 2018 at 10:52 AM, Douglas Gilbert wrote: On 2018-03-30 04:01 PM, Bart Van Assche wrote: On Fri, 2018-03-30 at 12:36 -0600, Tim Walker wrote: Yes I will be there to discuss the multi-LUN approach. I wanted to get these interface

Re: Multi-Actuator SAS HDD First Look

2018-03-31 Thread Douglas Gilbert
On 2018-03-30 04:01 PM, Bart Van Assche wrote: On Fri, 2018-03-30 at 12:36 -0600, Tim Walker wrote: Yes I will be there to discuss the multi-LUN approach. I wanted to get these interface details out so we could have some background and perhaps folks would come with ideas. I don't have much more

Re: Multi-Actuator SAS HDD First Look

2018-03-29 Thread Douglas Gilbert
On 2018-03-26 11:08 AM, Hannes Reinecke wrote: On Fri, 23 Mar 2018 08:57:12 -0600 Tim Walker wrote: Seagate announced their split actuator SAS drive, which will probably require some kernel changes for full support. It's targeted at cloud provider JBODs and RAID. Here are some of the drive's

[PATCH v5 5/7] scsi_io_completion_reprep helper added

2018-03-28 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 41 ++---

[PATCH v5 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-28 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/scsi

[PATCH v5 6/7] scsi_io_completion hints on fastpatch

2018-03-28 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement was so small, that ftrace ignored it. Inline timing code

[PATCH v5 0/7] scsi_io_completion cleanup

2018-03-28 Thread Douglas Gilbert
ying 4/7 . ChangeLog since v4 - introduce bool do_print to simplify conditionals in the case of a recovered error sense key in 2/7 rather than 3/7 ChangeLog since v3 - make use of bools sense_valid and sense_current consistent in 3/7 and 4/7 Douglas Gilbert (7): scs

[PATCH v5 4/7] scsi_io_completion_action helper added

2018-03-28 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbe

[PATCH v5 2/7] scsi_io_completion rename variables

2018-03-28 Thread Douglas Gilbert
Change and add some variable names, adjust some associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 72 ++--- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a

[PATCH v5 3/7] scsi_io_completion_nz_result function added

2018-03-28 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert --- A reviewer requested the original helper function's two return values be reduced to one: the

[PATCH v5 1/7] scsi_io_completion comment on end_request return

2018-03-28 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van

[PATCH v4 3/7] scsi_io_completion_nz_result function added

2018-03-28 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert --- A reviewer requested the original helper function's two return values be reduced to one: the

[PATCH v4 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-28 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/scsi

[PATCH v4 6/7] scsi_io_completion hints on fastpatch

2018-03-28 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement was so small, that ftrace ignored it. Inline timing code

[PATCH v4 5/7] scsi_io_completion_reprep helper added

2018-03-28 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 41 ++---

[PATCH v4 4/7] scsi_io_completion_action helper added

2018-03-28 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbe

[PATCH v4 0/7] scsi_io_completion cleanup

2018-03-28 Thread Douglas Gilbert
cmd, SCSI_MLQUEUE_EH_RETRY, 0); and __scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY, 0); need that trailing 0 changed to 'false', prior to applying 4/7 . Douglas Gilbert (7): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_resu

[PATCH v4 2/7] scsi_io_completion rename variables

2018-03-28 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 57 ++--- 1 file changed, 30

[PATCH v4 1/7] scsi_io_completion comment on end_request return

2018-03-28 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van

[PATCH v3 5/7] scsi_io_completion_reprep helper added

2018-03-27 Thread Douglas Gilbert
Since the action "reprep" is called from two places, rather than repeat the code, make a new scsi_io_completion helper with "reprep" as its suffix. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 41 ++--- 1 file changed,

[PATCH v3 1/7] scsi_io_completion comment on end_request return

2018-03-27 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van

[PATCH v3 0/7] scsi_io_completion cleanup

2018-03-27 Thread Douglas Gilbert
e. The fact remains, this is a very complex function. This patch is against Martin Petersen's 4.17/scsi-queue branch. Douglas Gilbert (7): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_result function added scs

[PATCH v3 4/7] scsi_io_completion_action helper added

2018-03-27 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbe

[PATCH v3 2/7] scsi_io_completion rename variables

2018-03-27 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 57 ++--- 1 file changed, 30 insertions(+), 27 deletions

[PATCH v3 7/7] scsi_io_completion convert BUGs to WARNs

2018-03-27 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi

[PATCH v3 6/7] scsi_io_completion hints on fastpatch

2018-03-27 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement was so small, that ftrace ignored it. Inline timing code

[PATCH v3 3/7] scsi_io_completion_nz_result function added

2018-03-27 Thread Douglas Gilbert
Break out several intertwined paths when cmd->result is non zero and place them in the scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert --- A reviewer requested the original helper function's two return values be reduced to one: the

Re: [PATCH v2 4/6] scsi_io_completion_action helper added

2018-03-27 Thread Douglas Gilbert
On 2018-03-26 08:13 PM, Bart Van Assche wrote: On Sun, 2018-03-18 at 21:59 +0100, Douglas Gilbert wrote: + /* sense not about current command is termed: deferred */ Do we really need comments that explain the SCSI specs? If such a comment is added I think it should be added above the

Re: How to Locate drive directly attached to mpt3sas HBA

2018-03-19 Thread Douglas Gilbert
On 2018-03-19 11:40 AM, Jack Wang wrote: Hi list, Any one knows how can I locate a HDD directly attached to mpt3sas, sas3ircu only supports LOCATE commd to locates driver installed in a disk enclosure, but not directly attached. I know microsemi/PMCs supports SGPIO interface to locate drive eg:

[PATCH v2 1/6] scsi_io_completion comment on end_request return

2018-03-18 Thread Douglas Gilbert
scsi_end_request() is called multiple times from scsi_io_completion() which branches on its bool returned value. Add comment before the static definition of scsi_end_request() about the meaning of that return. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- The reader might

[PATCH v2 4/6] scsi_io_completion_action helper added

2018-03-18 Thread Douglas Gilbert
Place scsi_io_completion()'s complex error processing associated with a local enumeration into a static helper function. That enumeration's values start with "ACTION_" so use the suffix "_action" in the helper function's name. Signed-off-by: Douglas Gilbe

[PATCH v2 2/6] scsi_io_completion rename variables

2018-03-18 Thread Douglas Gilbert
Change some variable names and associated comments for clarity. Correct some misleading comments. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_lib.c | 57 ++--- 1 file changed, 30 insertions(+), 27 deletions

[PATCH v2 6/6] scsi_io_completion convert BUGs to WARNs

2018-03-18 Thread Douglas Gilbert
The scsi_io_completion function contains three BUG() and BUG_ON() calls. Replace them with WARN variants. Signed-off-by: Douglas Gilbert --- This was done at a reviewer's request. This patchset did not change those BUG() lines but the git-diff suggested it did. Then the checkpatch.pl warned

[PATCH v2 0/6] scsi_io_completion cleanup

2018-03-18 Thread Douglas Gilbert
riginal function. The main thing to review is whether the refactoring is worthwhile and whether the logic remains the same after the refactoring. Douglas Gilbert (6): scsi_io_completion comment on end_request return scsi_io_completion rename variables scsi_io_completion_nz_result function a

[PATCH v2 5/6] scsi_io_completion hints on fastpatch

2018-03-18 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement was so small, that ftrace ignored it. Inline timing code

[PATCH v2 3/6] scsi_io_completion_nz_result function added

2018-03-18 Thread Douglas Gilbert
Break out several interwined paths when cmd->result is non zero and place them in scsi_io_completion_nz_result helper function. The logic is not changed. Signed-off-by: Douglas Gilbert --- A reviewer requested the original helper function's two return values be reduced to one: the

Re: Debugging SCSI 'UNMAP' ("Logical Block Provisioning") failure on an SSD

2018-03-15 Thread Douglas Gilbert
On 2018-03-15 01:45 PM, Martin K. Petersen wrote: Kashyap, /me naively wonders if it has anything to do with accessing it via Linux. I'm guessing that the drive doesn't actually support SCSI UNMAP. I have a T3 that reports all the right things in the bl/lbpv VPD pages but also has lbpme set

Re: Debugging SCSI 'UNMAP' ("Logical Block Provisioning") failure on an SSD

2018-03-15 Thread Douglas Gilbert
On 2018-03-15 10:47 AM, Kashyap Chamarthy wrote: On Wed, Mar 14, 2018 at 11:43:55PM -0400, Martin K. Petersen wrote: Kashyap, Hi Martin, Sorry, I didn't give you complete information — with the previous `dmesg` output, I actually attached the SSD (Samsung T5) via regular USB "A Cable". Now

Re: [PATCH 4/5] scsi_io_completion: conditional hints on fastpath

2018-03-14 Thread Douglas Gilbert
On 2018-03-09 10:13 AM, Johannes Thumshirn wrote: On Tue, Mar 06, 2018 at 10:21:33PM -0500, Douglas Gilbert wrote: ChangeLog: - add likely() and unlikely() hints to conditionals on or near the fastpath - fix a comment in scsi_io_completion_action() Do you have any numbers what this

Re: [PATCH] scsi: resolve COMMAND_SIZE at compile time

2018-03-10 Thread Douglas Gilbert
On 2018-03-10 03:49 PM, James Bottomley wrote: On Sat, 2018-03-10 at 14:29 +0100, Stephen Kitt wrote: Hi Bart, On Fri, 9 Mar 2018 22:47:12 +, Bart Van Assche wrote: On Fri, 2018-03-09 at 23:33 +0100, Stephen Kitt wrote: +/* + * SCSI command sizes are as follows, in bytes, for fixed siz

Re: dmesg flooded with "Very big device. Trying to use READ CAPACITY(16)"

2018-03-07 Thread Douglas Gilbert
On 2018-03-07 09:02 AM, Menion wrote: 2018-03-07 14:51 GMT+01:00 Steffen Maier : On 03/07/2018 09:24 AM, Menion wrote: ... but from then on, you only get it roughly once every 300 seconds, i.e. 5 minutes that's where I suspect user space as trigger, unless there is a kernel feature I'm not

[PATCH 4/5] scsi_io_completion: conditional hints on fastpath

2018-03-06 Thread Douglas Gilbert
ChangeLog: - add likely() and unlikely() hints to conditionals on or near the fastpath - fix a comment in scsi_io_completion_action() Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git

[PATCH 5/5] scsi_io_completion: convert BUGs to WARNs

2018-03-06 Thread Douglas Gilbert
ChangeLog: - replace BUG() and BUG_ON() with WARN variants. - try to send sensible reports (without flooding the log) and continuations that won't make things worse Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 14 +++--- 1 file changed, 11 insertions(

[PATCH 1/5] scsi_io_completion: rename variables and comments

2018-03-06 Thread Douglas Gilbert
ChangeLog: - add comments to scsi_end_request() noting what its bool return value means - change some variable names in scsi_io_completion() - reword some inline comments; move some comments that seemed to be separated from the code they referred to Signed-off-by: Douglas Gilbert

[PATCH 3/5] scsi_io_completion: add _action helper function

2018-03-06 Thread Douglas Gilbert
unction which is not permitted Note: the diff below gives a rather misleading view of what this patch does. Viewing it with difftool should make it clearer. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 235 ++-- 1 file changed, 12

[PATCH 2/5] scsi_io_completion: add _nz_result helper

2018-03-06 Thread Douglas Gilbert
a marker that the helper did not change the blk_status. This is cleaned up just after its invocation in scsi_io_completion. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 125 1 file changed, 74 insertions(+), 51 deletions(

[PATCH 0/5] scsi_io_completion cleanup

2018-03-06 Thread Douglas Gilbert
nings from checkpatch.pl and the encouragement of a reviewer, three BUG calls are converted to WARN calls. Suggestions for alternative recoveries are welcome. Douglas Gilbert (5): scsi_io_completion: rename variables and comments scsi_io_completion: add _nz_result helper scsi_io_completion: a

[PATCH v4] Make SCSI Status CONDITION MET equivalent to GOOD

2018-03-06 Thread Douglas Gilbert
in v3 and v2, leaving): - expand scsi_status_is_good() to check for CONDITION MET - add another corner case in scsi_io_completion() adjacent to the one for the RECOVERED ERROR sense key case. That is another "non-error" Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c |

Re: [PATCH v2 0/2] scsi_io_completion cleanup and fix CONDITION MET handling

2018-03-06 Thread Douglas Gilbert
Since this patchset seems to have frightened away reviewers, I'll try again. Now I'll send a single patch to do the fix for CONDITION MET. That will be followed by a 5 part patchset cleaning up the scsi_io_completion() function. Douglas Gilbert On 2018-02-28 01:23 AM, Douglas Gil

[PATCH v2 2/2] scsi_io_completion convert BUG to WARN calls

2018-02-27 Thread Douglas Gilbert
ChangeLog: - convert 3 BUG calls to WARN calls - un-invert some conditional logic to uncover the real fast path - try to improve the comments, including noting what the bool return value from scsi_end_request() means Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 45

[PATCH v2 0/2] scsi_io_completion cleanup and fix CONDITION MET handling

2018-02-27 Thread Douglas Gilbert
cmd->result is non-zero) This patch is against mkp's 4.17/scsi-queue branch. It also applies to lk 4.15.x where it was tested on a SAS SSD. Douglas Gilbert (2): scsi_io_completion cleanup and fix CONDITION MET handling scsi_io_completion-change2warn drivers/scsi/scsi_lib.c | 304 +++

[PATCH v2 1/2] scsi_io_completion split, fix CONDITION MET handling

2018-02-27 Thread Douglas Gilbert
The "ChangeLog for v1" section in 0/2 (the cover letter) of this patch set outlines the changes in this patch. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 297 +--- include/scsi/scsi.h | 2 + 2 files changed, 181

Re: [PATCH] scsi_io_completion cleanup and fix CONDITION MET handling

2018-02-27 Thread Douglas Gilbert
On 2018-02-27 05:00 AM, Johannes Thumshirn wrote: On Mon, 2018-02-26 at 13:48 -0500, Douglas Gilbert wrote: Note: checkpatch.pl suggests that the BUG and BUG_ON macros be replaced by WARN and WARN_ON . Perhaps others could comment on this. Yes BUG() and BUG_ON() are usually a bad idea. Linus

[PATCH] scsi_io_completion cleanup and fix CONDITION MET handling

2018-02-26 Thread Douglas Gilbert
macros be replaced by WARN and WARN_ON . Perhaps others could comment on this. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 297 +--- include/scsi/scsi.h | 2 + 2 files changed, 181 insertions(+), 118 deletions(-) diff --git a/dri

Re: [PATCH] scsi: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()

2018-02-26 Thread Douglas Gilbert
ned-off-by: Hannes Reinecke Reviewed-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index aea5a1ae318b..11d63136f0bd 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -72

Re: [PATCH v2] Make SCSI Status CONDITION MET equivalent to GOOD

2018-02-26 Thread Douglas Gilbert
On 2018-02-26 02:25 AM, Hannes Reinecke wrote: On 02/25/2018 07:29 PM, Douglas Gilbert wrote: The SCSI PRE-FETCH (10 or 16) command is present both on hard disks and some SSDs. It is useful when the address of the next block(s) to be read is known but it is not following the LBA of the current

[PATCH v3] Make SCSI Status CONDITION MET equivalent to GOOD

2018-02-25 Thread Douglas Gilbert
are only on the error path (i.e. when cmd->result is non-zero) This patch is against mkp's 4.17/scsi-queue branch. It also applies to lk 4.15.x where it was re-tested on a SAS SSD. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 290 -

[PATCH v2] Make SCSI Status CONDITION MET equivalent to GOOD

2018-02-25 Thread Douglas Gilbert
o extra checks are only on the error path (i.e. when cmd->result is non-zero) This patch is against mkp's 4.17/scsi-queue branch. It also applies to lk 4.15.x where it was re-tested on a SAS SSD. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_lib.c | 140 ++

Re: [PATCH v2] scsi: handle special return codes for ABORTED COMMAND

2018-02-23 Thread Douglas Gilbert
22.1) and is not cross-referenced anywhere that I can find. So anyway, Martin (P.), could we have and explanation somewhere prominent in our code what DIF and DIX mean in SCSI (and other standards) terms? But that is not this patch's problem, so: Reviewed-by: Douglas Gilbert

[PATCH] Make SCSI Status CONDITION MET equivalent to GOOD

2018-02-21 Thread Douglas Gilbert
s another "non-error" - structure code so extra checks are only on the error path (i.e. when cmd->result is non-zero) This patch is against mkp's 4.17/scsi-queue branch. It also applies to lk 4.15.x where it was tested on a SAS SSD. Signed-

Re: [PATCH v2] scsi_debug: call resp_*() function after setting host_scribble

2018-02-15 Thread Douglas Gilbert
in schedule_resp() is slightly different now for the IMMED case - instead of falling through to the "respond_in_thread" label immediately, the command will be put in the work queue with zero delay. Signed-off-by: Martin Wilck Ack-ed by:

Re: [PATCH] scsi: scsi_debug: Fix pointer stying issues

2018-02-09 Thread Douglas Gilbert
ted. Signed-off-by: John Pittman Ack-ed by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 72 +++ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5986da..a1f867f

[PATCH v2] scsi_debug: implement IMMED bit

2018-02-09 Thread Douglas Gilbert
ately - if the IMMED bit is clear, treat the delay parameter as having a unit of one second - in the SYNCHRONIZE CACHE processing do a bounds check Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 76 --- 1 file changed, 65 insertions(+

Re: [PATCH] scsi_debug: Add two new parameters to scsi_debug driver

2018-02-06 Thread Douglas Gilbert
is set then we don't use the default of OPT_MEDIUM_ERR_ADDR, but use that set value. If medium_error_count is set we use that value otherwise default to OPT_MEDIUM_ERR_NUM. Signed-off-by: Laurence Oberman Tested-by: Laurence Oberman Acked-by: Douglas Gilbert drivers/scsi/scsi_de

Re: scsi: sg: assorted memory corruptions

2018-01-31 Thread Douglas Gilbert
On 2018-01-30 07:22 AM, Dmitry Vyukov wrote: Uh, I've answered this a week ago, but did not notice that Doug dropped everybody from CC. Reporting to all. On Mon, Jan 22, 2018 at 8:16 PM, Douglas Gilbert wrote: On 2018-01-22 02:06 PM, Dmitry Vyukov wrote: On Mon, Jan 22, 2018 at 7:

Re: [PATCH] scsi_debug: implement IMMED bit

2018-01-31 Thread Douglas Gilbert
On 2018-01-31 05:05 PM, Bart Van Assche wrote: On Wed, 2018-01-31 at 15:26 -0500, Douglas Gilbert wrote: On 2018-01-31 12:06 PM, Bart Van Assche wrote: On 01/29/18 21:54, Douglas Gilbert wrote: +static const struct opcode_info_t sync_cache_iarr[] = { +{0, 0x91, 0, F_LONG_DELAY

Re: [PATCH] scsi_debug: implement IMMED bit

2018-01-31 Thread Douglas Gilbert
On 2018-01-31 12:06 PM, Bart Van Assche wrote: On 01/29/18 21:54, Douglas Gilbert wrote: +static const struct opcode_info_t sync_cache_iarr[] = { +    {0, 0x91, 0, F_LONG_DELAY | F_M_ACCESS, resp_sync_cache, NULL, +    {16,  0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

Re: [PATCH] scsi_debug: Simplify request tag decoding

2018-01-31 Thread Douglas Gilbert
Since this means that the sdebug_mq_active variable is superfluous, remove it. Signed-off-by: Bart Van Assche Cc: Douglas Gilbert Ack-ed by Douglas Gilbert Cc: Christoph Hellwig Cc: Hannes Reinecke --- drivers/scsi/scsi_debug.c | 37 +++-- 1 file c

[PATCH] scsi_debug: implement IMMED bit

2018-01-29 Thread Douglas Gilbert
er as having a unit of one second - in the SYNCHRONIZE CACHE processing do a bounds check Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 76 --- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/scsi_debu

Mishandling SCSI status CONDITION MET

2018-01-26 Thread Douglas Gilbert
Summary: CONDITION MET is a GOOD status but the mid-level logs it as if it were an error. If you scan recent SPC and SBC drafts you will find only two commands that yield the SCSI status CONDITION MET: PRE-FETCH(10) and PRE_FETCH(16). Those commands are like READ but don't return the data instead

Re: [PATCH] scsi_debug: Use scsi-mq if it has been enabled

2018-01-23 Thread Douglas Gilbert
Cc: Douglas Gilbert Cc: Hannes Reinecke Cc: Christoph Hellwig Acked: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5986dae9020..40df3eea72c8 100644 --- a

Re: scsi: sg: assorted memory corruptions

2018-01-22 Thread Douglas Gilbert
On 2018-01-22 11:30 AM, Bart Van Assche wrote: On Mon, 2018-01-22 at 12:06 +0100, Dmitry Vyukov wrote: general protection fault: [#1] SMP KASAN How about the untested patch below? Thanks, Bart. diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index cd9b6ebd7257..04a644b39d79 100644

[PATCH] blk_rq_map_user_iov: fix error override

2018-01-14 Thread Douglas Gilbert
: ret =__blk_rq_map_user_iov(rq, map_data, &i, gfp_mask, copy); That 'ret' was being overridden when that function failed. Signed-off-by: Douglas Gilbert --- block/blk-map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-map.c b/block/b

Re: scsi: memory leak in sg_start_req

2018-01-10 Thread Douglas Gilbert
On 2018-01-09 11:05 AM, Dmitry Vyukov wrote: Hello, syzkaller has found the following memory leak: unreferenced object 0x88004c19 (size 8328): comm "syz-executor", pid 4627, jiffies 4294749150 (age 45.507s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00

[PATCH 0/1] scsi_debug: delay stress fix

2018-01-10 Thread Douglas Gilbert
queue or a hr timer to exhaust). Douglas Gilbert (1): scsi_debug: delay fix drivers/scsi/scsi_debug.c | 72 ++- 1 file changed, 46 insertions(+), 26 deletions(-) -- 2.14.1

[PATCH 1/1] scsi_debug: delay stress fix

2018-01-10 Thread Douglas Gilbert
simplifies command cancellation handling. Now the delay associated with a deferred response of a command cannot be changed (once started) by changing the delay (and ndelay) parameters in sysfs. Command aborts and driver shutdown are still honoured immediately when received. Signed-off-by: Douglas

Re: [PATCH 13/14] megaraid_sas: NVME passthru command support

2018-01-10 Thread Douglas Gilbert
On 2018-01-10 11:22 AM, Bart Van Assche wrote: On Tue, 2018-01-09 at 22:07 +0530, Kashyap Desai wrote: Overall NVME support behind MR controller is really a SCSI device. On top of that, for MegaRaid, NVME device can be part of Virtual Disk and those drive will not be exposed to the driver. User

Re: [PATCH 13/14] megaraid_sas: NVME passthru command support

2018-01-09 Thread Douglas Gilbert
, it is just another one, and not a particularly clean one. IMO Intel had their chance on the pass-through front, and blew it. It is now too late to fix it and that job (impossible ?) should not fall to MegaRaid maintainers. Douglas Gilbert

Re: [PATCH v2.2] sd: Micro-optimize READ / WRITE CDB encoding

2018-01-03 Thread Douglas Gilbert
On 2017-10-26 02:31 AM, Martin K. Petersen wrote: Doug, The sd_setup_read_write_cmnd() function is on the "fast path" for block system access to SCSI devices (logical units). Rewrite this function to improve speed and readability. Please do any optimizations on top of my scsi-work branch whi

Re: [PATCH for sg3_utils 0/4] Simplify the sg3_utils configure script

2018-01-03 Thread Douglas Gilbert
On 2018-01-03 04:37 AM, Bean Huo (beanhuo) wrote: Hi, Bart and Dong Do you think we need to submit all changed diff including some generated files by automake? Such as config.h.in, Makefile.in..., in fact, we only manually did a few modificaiton on Some files such as configura.ac,makefile.am.

[PATCH v3 5/5] scsi_debug: add resp_write_scat function

2017-12-23 Thread Douglas Gilbert
Add resp_write_scat() function to support decoding WRITE SCATTERED (16 and 32). Also weave resp_write_scat() into the cdb decoding logic. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 179 +- 1 file changed, 176 insertions(+), 3

[PATCH v3 3/5] scsi_debug: do_device_access add sg offset argument

2017-12-23 Thread Douglas Gilbert
WRITE SCATTERED needs to take several "bites" out of the data-out buffer. Expand the do_device_access() function to take a sg_skip argument. Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_debug.c | 15 --- 1 file changed, 8 insert

[PATCH v3 0/5] scsi_debug: add write scattered support

2017-12-23 Thread Douglas Gilbert
Bart Van Assche) - expand in-code comments Douglas Gilbert (5): scsi_debug: tab, kstrto changes scsi_debug: fix group_number mask scsi_debug: do_device_access add sg offset argument scsi_debug: ARRAY_SIZE and FF_MEDIA_IO scsi_debug: add resp_write_scat function drivers/scsi/scsi_debug

[PATCH v3 1/5] scsi_debug: tab, kstrto changes

2017-12-23 Thread Douglas Gilbert
Some of my development tools tend to add spaces (my preference) rather than tabs (kernel convention). Running unexpand to clean these spaces up found more of them than checkpatch.pl did. Then checkpatch.pl complained about other style violations in those newly tabbed lines. Signed-off-by: Douglas

[PATCH v3 4/5] scsi_debug: ARRAY_SIZE and FF_MEDIA_IO

2017-12-23 Thread Douglas Gilbert
ems a more accurate description. Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_debug.c | 163 +- 1 file changed, 90 insertions(+), 73 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c

[PATCH v3 2/5] scsi_debug: fix group_number mask

2017-12-23 Thread Douglas Gilbert
Various cdb masks incorrectly assumed the GROUP NUMBER field was 5 bits long. It is actually 6 bits long. Correct. Also fix mask failure (in same byte) to allow DLD0 in READ(16) and WRITE(16). Signed-off-by: Douglas Gilbert Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_debug.c | 28

Re: [RFC] sg3_utils: sgp_dd: work around on pthread_cancel for android

2017-12-22 Thread Douglas Gilbert
On 2017-12-22 01:24 PM, Bart Van Assche wrote: On Fri, 2017-12-22 at 17:00 +, Bean Huo (beanhuo) wrote: case "${host}" in +*-*-android*) + AC_DEFINE_UNQUOTED(SG_ON_ANDROID, 1, [sg3_utils on android]) + AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on li

Re: [PATCH v2 5/5] scsi_debug: add resp_write_scat function

2017-12-14 Thread Douglas Gilbert
On 2017-12-14 05:57 PM, Bart Van Assche wrote: On Wed, 2017-12-13 at 20:40 -0500, Douglas Gilbert wrote: + {0, 0x7f, 0x11, F_SA_HIGH | F_D_OUT | FF_MEDIA_IO, resp_write_scat, + NULL, {32, 0xc7, 0, 0, 0, 0, 0x3f, 0x18, 0x0, 0x11, 0xf8, + 0, 0xff, 0xff, 0x0, 0x0

[PATCH v2 5/5] scsi_debug: add resp_write_scat function

2017-12-13 Thread Douglas Gilbert
Add resp_write_scat() function to support decoding WRITE SCATTERED (16 and 32). Also weave resp_write_scat() into the cdb decoding logic. Signed-off-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 182 +- 1 file changed, 179 insertions(+), 3

<    1   2   3   4   5   6   7   8   9   10   >