Re: [PATCH V2] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-12 Thread Douglas Gilbert
On 2018-11-12 11:32 a.m., Bean Huo (beanhuo) wrote: This patch is to convert inputted string to the integer when read data from stdin. While entering data flow, the data between bytes can be separated by either space, or ',' (or by '.'). V1-V2: 1. Rebased the patch on the latest

Re: [PATCH v1] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-09 Thread Douglas Gilbert
On 2018-11-09 7:18 p.m., Bean Huo (beanhuo) wrote: This patch is to convert inputted string to the integer when read data from stdin. While entering data, the data between bytes can be separated by space, or by ',' or by '.'. Could you send me this patch against sg_write_buffer.c as found in

Re: [PATCH] rescan-scsi-bus.sh: use LUN wildcard in idlist

2018-11-08 Thread Douglas Gilbert
On 2018-10-25 10:49 a.m., Martin Wilck wrote: By scanning for LUN 0 only, we may encounter a device that the kernel won't add (e.g. peripheral device type 31) and which may thus never appear in sysfs for us to use for REPORT LUNS. That causes LUN additions for such devices to be missed by

Re: [PATCH v3 0/8] sg: major cleanup, remove max_queue limit

2018-10-28 Thread Douglas Gilbert
For anyone thinking of testing this patchset, it also applies clean to lk 4.19 release. Doug Gilbert On 2018-10-26 12:48 p.m., Douglas Gilbert wrote: The intention is to add two new ioctls as proposed by Linus Torvalds: SG_IOSUBMIT and SG_IORECEIVE to replace the write()/read() async interface

Re: [PATCH v3 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
On 2018-10-26 12:48 p.m., Douglas Gilbert wrote: Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Also add a read_value integer the can be used by write a value from

[PATCH v3.5 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

[PATCH v3 6/8] sg: complete locking changes on ioctl+debug

2018-10-26 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH v3 3/8] sg: split header, expand and correct descriptions

2018-10-26 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH v3 4/8] sg: expand request states

2018-10-26 Thread Douglas Gilbert
. SG_TOT_FD_THRESHOLD is a default, per file descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch (5 of 8) to be a bit

[PATCH v3 7/8] sg: rework ioctl handling

2018-10-26 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH v3 8/8] sg: user controls for q_at_head, read_value

2018-10-26 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

[PATCH v3 5/8] sg: add free list, rework locking

2018-10-26 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window, or simply view the before sg.c and the after sg.c . The requirement to keep the patch small enough to be reviewable

[PATCH v3 1/8] sg: types and naming cleanup

2018-10-26 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

[PATCH v3 2/8] sg: introduce sg_log macro

2018-10-26 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- Reviewers want SCSI_LOG_* style logging replaced. But with what? One suggestion

[PATCH v3 0/8] sg: major cleanup, remove max_queue limit

2018-10-26 Thread Douglas Gilbert
compile/build problem around the 4th and 5th patches - add read_value[SG_SEIRV_*] options in SG_SET_GET_EXTENDED ioctl and increase structure size from 64 to 96 bytes Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-24 Thread Douglas Gilbert
On 2018-10-24 3:58 a.m., Martin K. Petersen wrote: Hi Doug, I'll follow what the scsi mid-level and the other ULDs do. IOW, no change. The debug messages they produce are quite helpful (to me, I use them a lot, and Tony B. has asked for more precision) and well-tuned to the SCSI subsystem

Re: [PATCH v2 3/8] sg: split header, expand and correct descriptions

2018-10-21 Thread Douglas Gilbert
On 2018-10-20 11:21 p.m., Douglas Gilbert wrote: Split scsi/sg.h into a smaller scsi/sg.h which includes a new header: uapi/scsi/sg.h . Overall expand the twin header files with new functionality in this patchset and functionality to be added in the next patchset to implement SG_IOSUBMIT

[PATCH v2 4/8] sg: expand request states

2018-10-20 Thread Douglas Gilbert
. SG_TOT_FD_THRESHOLD is a default, per file descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch (5 of 8) to be a bit

[PATCH v2 6/8] sg: complete locking changes on ioctl+debug

2018-10-20 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH v2 0/8] sg: major cleanup, remove max_queue limit

2018-10-20 Thread Douglas Gilbert
around the 4th and 5th patches - add read_value[SG_SEIRV_*] options in SG_SET_GET_EXTENDED ioctl and increase structure size from 64 to 96 bytes Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct descriptions sg: expand

[PATCH v2 2/8] sg: introduce sg_log macro

2018-10-20 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file

[PATCH v2 3/8] sg: split header, expand and correct descriptions

2018-10-20 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH v2 7/8] sg: rework ioctl handling

2018-10-20 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH v2 8/8] sg: user controls for q_at_head, read_value

2018-10-20 Thread Douglas Gilbert
will be returned. Signed-off-by: Douglas Gilbert --- The user can still override the new file scope setting on a a per command basis with the SG_FLAG_Q_AT_HEAD and SG_FLAG_Q_AT_TAIL in the sg v3 and v4 structures. An example of read_value usage is to write the value SG_SEIRV_FL_RQS

[PATCH v2 5/8] sg: add free list, rework locking

2018-10-20 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window, or simply view the before sg.c and the after sg.c . drivers/scsi/sg.c | 1241 +++-- 1

[PATCH v2 1/8] sg: types and naming cleanup

2018-10-20 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

Re: [PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 11:22 a.m., Bart Van Assche wrote: On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: static void -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo) +sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo, + int max_num

Re: [PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 4:31 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: +/* Alternate style type names, "..._t" variants preferred */ +typedef struct sg_io_hdr Sg_io_hdr; +typedef struct sg_io_vec Sg_io_vec; +typedef struct sg_scsi_id Sg_scsi_id; +typedef struct s

Re: [PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
On 2018-10-19 3:45 a.m., Johannes Thumshirn wrote: On 19/10/18 08:24, Douglas Gilbert wrote: [..] +/* + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages. + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most + * information). All messages are logged

[PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-19 Thread Douglas Gilbert
. Correct and expand some comments. Signed-off-by: Douglas Gilbert --- The new header file: uapi/scsi/sg.h is expected to be in the kernel's public interface. This takes time (i.e. months or years) to find its way into glibc and Linux distributions. So the sooner it is presented and accepted

[PATCH 7/8] sg: rework ioctl handling

2018-10-19 Thread Douglas Gilbert
er (the "_GET_" part) in a single operation. Signed-off-by: Douglas Gilbert --- One feature of the new SG_SET_GET_EXTENDED ioctl is ability to fetch the sg device minor number (e.g. the "3" in /dev/sg3) associated with the current file descriptor. A boolean addition is t

[PATCH 5/8] sg: add free list, rework locking

2018-10-19 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is big and complex. Towards the end the diff program completely loses the plot. Better to use difftool on a two pane window. drivers/scsi/sg.c | 1225 +++-- 1 file changed, 739 insertions(+), 486 deletions

[PATCH 6/8] sg: complete locking changes on ioctl+debug

2018-10-19 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable subst

[PATCH 8/8] sg: user control for q_at_head or tail

2018-10-19 Thread Douglas Gilbert
Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Signed-off-by: Douglas Gilbert --- The user can still override this setting on a per command basis

[PATCH 1/8] sg: types and naming cleanup

2018-10-19 Thread Douglas Gilbert
Remove typedefs and use better type names like bool and u8 where appropriate. Rename some variables and functions for clarity. Adjust formatting (e.g. function definitions) to be more consistent across the driver. Signed-off-by: Douglas Gilbert --- The intention is to move to sg_version_num

[PATCH 4/8] sg: expand request states

2018-10-19 Thread Douglas Gilbert
descriptor value that the sum of outstanding command data lengths is not allowed to exceed. Signed-off-by: Douglas Gilbert --- The '#if 0's are temporary and removed in a later patch. They allow the following large and complex patch to be a bit shorter and still compile. drivers/scsi/sg.c | 27

[PATCH 0/8] sg: major cleanup, remove max_queue limit

2018-10-19 Thread Douglas Gilbert
branch. Douglas Gilbert (8): sg: types and naming cleanup sg: introduce sg_log macro sg: split header, expand and correct descriptions sg: expand request states sg: add free list, rework locking sg: complete locking changes on ioctl+debug sg: rework ioctl handling sg: user control

[PATCH 2/8] sg: introduce sg_log macro

2018-10-19 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file

Re: [PATCH] bsg: convert to use blk-mq

2018-10-17 Thread Douglas Gilbert
On 2018-10-17 11:55 a.m., Benjamin Block wrote: On Tue, Oct 16, 2018 at 08:43:01AM -0600, Jens Axboe wrote: Requires a few changes to the FC transport class as well. Cc: Johannes Thumshirn Cc: Benjamin Block Cc: linux-scsi@vger.kernel.org Signed-off-by: Jens Axboe --- block/bsg-lib.c

Re: [PATCH] sg: remove bad blk_end_request_all() call

2018-10-16 Thread Douglas Gilbert
a request is "in flight" and a surprise removal occurs, can the sg driver expect the block layer (or scsi mid-level) to react (and clean-up) or is it up to the sg driver to force those actions? Acked-by: Douglas Gilbert Cc: Doug Gilbert Cc: linux-scsi@vger.kernel.org Signed-off-by:

Re: [PATCH v2 1/8] scsi: Add ufs transport class

2018-08-09 Thread Douglas Gilbert
On 2018-08-09 07:51 PM, Bart Van Assche wrote: On Thu, 2018-08-09 at 23:32 +, Avri Altman wrote: And as I said before, we think that maintaining the flexibility to have more-than-one bsg device nodes, will be useful serving as a testing and validation environment. That is a very vague

Re: [RFC PATCH 3/5] streamline REQ_OP_READ-WRITE access

2018-08-06 Thread Douglas Gilbert
On 2018-08-06 01:41 AM, Damien Le Moal wrote: On 2018/08/06 13:51, Douglas Gilbert wrote: Make the two block layer operations most frequently used (REQ_OP_READ and REQ_OP_WRITE) bypass the switch statements in the submission and response paths. Assume these two enums are 0 and 1 which allows

Re: [RFC PATCH 4/5] streamline some logical operations

2018-08-06 Thread Douglas Gilbert
On 2018-08-06 01:41 AM, Damien Le Moal wrote: On 2018/08/06 13:51, Douglas Gilbert wrote: Re-arrange some logic to lessen the number of checks. With logical ANDs put the least likely first, with logical ORs put the most likely first. Also add conditional hints on the assumed fastpath. Signed

Re: [RFC PATCH 2/5] break sd_done sense processing out to own function

2018-08-06 Thread Douglas Gilbert
On 2018-08-06 01:41 AM, Damien Le Moal wrote: On 2018/08/06 13:51, Douglas Gilbert wrote: Break out the sense key handling in the sd_done() (response) path into its own function. Note that the sense key only needs to be inspected when a SCSI status of Check Condition is returned. It looks

Re: [RFC PATCH 1/5] add tweakable bounds_check flag, now off by default

2018-08-06 Thread Douglas Gilbert
On 2018-08-06 01:41 AM, Damien Le Moal wrote: Douglas, On 2018/08/06 13:51, Douglas Gilbert wrote: Add bounds_check "rw" attribute to the sd driver. It controls whether each read/write operation submission does an "out of range" bounds check and a LBA/number_of_blocks al

[RFC PATCH 1/5] add tweakable bounds_check flag, now off by default

2018-08-05 Thread Douglas Gilbert
erent it is possible that there is an alignment issue. But if that occurs, it would be a logic issue in the block layer. Note that the current mainline code does this check even when it is not needed (e.g. when the logical block size of the disk is 512 bytes). Signed-off-by: Douglas Gilbert --- Should a m

[RFC PATCH 4/5] streamline some logical operations

2018-08-05 Thread Douglas Gilbert
Re-arrange some logic to lessen the number of checks. With logical ANDs put the least likely first, with logical ORs put the most likely first. Also add conditional hints on the assumed fastpath. Signed-off-by: Douglas Gilbert --- drivers/scsi/sd.c | 43

[RFC PATCH 3/5] streamline REQ_OP_READ-WRITE access

2018-08-05 Thread Douglas Gilbert
-off-by: Douglas Gilbert --- drivers/scsi/sd.c | 82 +++ 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 4b1402633c36..9f047fd3c92d 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c

[RFC PATCH 0/5] sd: init_command() and sd_done() speed-ups

2018-08-05 Thread Douglas Gilbert
scsi_debug driver. Douglas Gilbert (5): add tweakable bounds_check flag, now off by default break sd_done sense processing out to own function streamline REQ_OP_READ-WRITE access streamline some logical operations make sd_done() REQ_OP_FLUSH handling explicit drivers/scsi/

[RFC PATCH 2/5] break sd_done sense processing out to own function

2018-08-05 Thread Douglas Gilbert
Break out the sense key handling in the sd_done() (response) path into its own function. Note that the sense key only needs to be inspected when a SCSI status of Check Condition is returned. Signed-off-by: Douglas Gilbert --- No speed up here, just a clean up. There could possibly be a speed

Re: [RFC 0/6] scsi: scsi transport for ufs devices

2018-07-30 Thread Douglas Gilbert
On 2018-07-30 02:13 PM, Hannes Reinecke wrote: On 07/30/2018 08:01 PM, Bart Van Assche wrote: On Sun, 2018-07-29 at 16:33 +0300, Avri Altman wrote: Here is a proposal to use the scsi transport subsystem to manage ufs devices. scsi transport is a framework that allow to send scsi commands to a

[PATCH v2] scsi_debug: add cmd abort option to every_nth

2018-07-20 Thread Douglas Gilbert
g: https://lore.kernel.org/lkml/a68ad043-26a1-d3d8-2009-504ba4230...@oracle.com/ Also convert two vmalloc/memset(0) to vzalloc() calls. Signed-off-by: Douglas Gilbert --- Changes since original version: - thanks to changes/fixes suggested by Bart Van Assche, mainly to avoid calling scsi_done()

Re: [PATCH] sg: update comment for blk_get_request()

2018-07-12 Thread Douglas Gilbert
On 2018-07-12 06:09 PM, Tony Battersby wrote: The calling convention of blk_get_request() has changed in lk 4.18; update the comment in sg.c to match. Fixes: ff005a066240 ("block: sanitize blk_get_request calling conventions") Signed-off-by: Tony Battersby Acked-by: Douglas Gilbert

Re: [PATCH] sg: fix minor memory leak in error path

2018-07-12 Thread Douglas Gilbert
On 2018-07-12 02:46 PM, Tony Battersby wrote: Fix a minor memory leak when there is an error opening a /dev/sg device. Signed-off-by: Tony Battersby Acked-by: Douglas Gilbert Thanks. --- diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index cd2fdac..2962a38 100644 --- a/drivers/scsi

[PATCH] scsi_debug: skip long delays when ndelay small

2018-07-12 Thread Douglas Gilbert
. Signed-off-by: Douglas Gilbert --- This patch is against MKP's 4.19/scsi-queue branch. Re-arrange if condition so least likely is first part of && . drivers/scsi/scsi_debug.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/driv

Re: [PATCH v6 7/7] scsi_io_completion convert BUGs to WARNs

2018-06-26 Thread Douglas Gilbert
On 2018-06-26 07:28 AM, Hannes Reinecke wrote: On 06/23/2018 12:22 PM, Douglas Gilbert wrote: 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 Reviewed-by: Bart Van Assche

[PATCH v6 6/7] scsi_io_completion hints on fastpatch

2018-06-23 Thread Douglas Gilbert
Add likely() and unlikely() hints to conditionals on or near the fastpath. Signed-off-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement was so small, that ftrace ignored

[PATCH v6 4/7] scsi_io_completion_action helper added

2018-06-23 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 Gilbert Reviewed-by

[PATCH v6 1/7] scsi_io_completion: comment on end_request return

2018-06-23 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 v6 0/7] scsi_io_completion cleanup

2018-06-23 Thread Douglas Gilbert
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): scsi_io_completion: comment on end_request return scsi_i

[PATCH v6 3/7] scsi_io_completion_nz_result: function added

2018-06-23 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 Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche --- A reviewer requested the origi

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

2018-06-23 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 Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions

[PATCH v6 2/7] scsi_io_completion: rename variables

2018-06-23 Thread Douglas Gilbert
Change and add some variable names, adjust some 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 | 72 ++--- 1 file

[PATCH v6 5/7] scsi_io_completion_reprep helper added

2018-06-23 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 Reviewed-by: Bart Van Assche --- drivers/

Re: [patch] sg: clean up gfp_mask in sg_build_indirect

2018-06-18 Thread Douglas Gilbert
_SYS_RAWIO)) gfp_mask |= __GFP_ZERO; And there's only one user of the gfp_mask. Just or in the __GFP_ZERO flag at the top of the function and be done with it. Signed-off-by: Jeff Moyer Acked-by: Douglas Gilbert p.s. I'm not even sure why the original patch was committed -- it do

Re: sd 6:0:0:0: [sdb] Unaligned partial completion

2018-06-11 Thread Douglas Gilbert
On 2018-06-11 12:07 PM, Ted Cabeen wrote: I'm seeing a similar behavior on my system, but across multiple devices on a SAS drive array (front bays on a Supermicro-based system with onboard mpt3sas card). The Sense Key here doesn't show a medium error, and the multiple-drive behavior makes me

Re: RAID6: "Bad block number requested"

2018-06-11 Thread Douglas Gilbert
On 2018-06-11 11:06 AM, James Bottomley wrote: On Mon, 2018-06-11 at 16:24 +0200, Sebastian Hegler wrote: Dear all, First off: sorry for cross-posting. I don't know if this is a RAID issue or a SCSI issue, so I'll just ask y'all. For a RAID6 capacity upgrade (higher capacity drives), we

RFC + testing: lsscsi-0.30 beta (rev 153)

2018-06-06 Thread Douglas Gilbert
It has been a while since the last release of lsscsi: 0.29 was sort of released on 2016/05/14 and lsscsi 0.28 on 2014/09/30 . A few bug fixes have got out thanks to the github (now Microsoft) mirror that Hannes Reinecke maintains. Recently there have been some additions and some folks have found

[PATCH] scsi_lib: sanitize++ in progress

2018-05-18 Thread Douglas Gilbert
"Sanitize in progress" plus some other recent "... in progress" additional sense codes into the scsi mid-level so they are treated in a similar fashion to "Format in progress". Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c |

Re: [PATCH] scsi: sg: fix a missing-check bug

2018-05-06 Thread Douglas Gilbert
On 2018-05-05 11:21 PM, Wenwen Wang wrote: In sg_write(), the opcode of the command is firstly copied from the userspace pointer 'buf' and saved to the kernel variable 'opcode', using the __get_user() function. The size of the command, i.e., 'cmd_size' is then calculated based on the 'opcode'.

[PATCH] scsi_debug: replace SDEG_RES_IMMED_MASK with cmnd flag

2018-04-18 Thread Douglas Gilbert
still caused some confusion so a more conventional method is now used: adding an extra flag to the scsi_cmnd "host_scribble" area. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- This patch is designed to simplify part of the patchset titled: "Rework SCSI results h

Re: [VERY EARLY RFC 00/13] Rework SCSI results handling

2018-04-18 Thread Douglas Gilbert
On 2018-04-18 11:01 AM, Johannes Thumshirn wrote: Hey all, here's a early preview of my SCSI results rework so we can eventually discuss things next week at LSF/MM (it still has compiler errors on aic7xxx and scsi_debug). The motivation behing this is that some drivers have failed to set the

Re: [PATCH] scsi: Change return type to vm_fault_t

2018-04-14 Thread Douglas Gilbert
On 2018-04-14 02:47 PM, Souptick Joarder wrote: Use new return type vm_fault_t for fault handler in struct vm_operations_struct. Signed-off-by: Souptick Joarder <jrdr.li...@gmail.com> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> Acked-by: Douglas Gilbert <dgilb.

Re: [PATCH v3 0/3] Report all request failures again to user space

2018-04-11 Thread Douglas Gilbert
On 2018-04-11 12:25 PM, Johannes Thumshirn wrote: On Wed, Apr 11, 2018 at 12:20:49PM -0400, Martin K. Petersen wrote: Johannes, While we're at it, anyone still in love with the non SAM_ status bytes? If not they'll be gone afterwards as well. /me is up for some spring cleaning. Just be

[PATCH] scsi_debug: IMMED related delay adjustments

2018-04-10 Thread Douglas Gilbert
d; SC only delays when there's been a write since the previous SC. It also reduced the SC delay from 1 second to 50 milliseconds. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- This patch is in response to a report on the Linux scsi list indicating a significant slowdown in

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 <dgilb...@interlog.com> wrote: On 2018-04-06 02:42 AM, Christoph Hellwig wrote: On Fri, Apr 06, 2018 at 08:24:18AM +0200, Hannes Reinecke wrote

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

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

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

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

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

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 <damien.lem...@wdc.com> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Hannes Reinecke <h...@suse

[PATCH] scsi: fix __scsi_error_from_host_byte() breakage

2018-04-04 Thread Douglas Gilbert
rs present in the driver_byte and the status byte. Add those checks and expand description of function accordingly. Signed-off-by: Douglas Gilbert <dgilb...@interlog.com> --- The function would be better called blk_status_from_scsi_result(). Is the leading "__" needed? drivers/scsi/scsi

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

2018-04-04 Thread Douglas Gilbert
lus 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 <damien.lem...@wdc.com> Signed-off-by: Bart Van Assche <bart.vanass...@wdc

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: 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

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 <dgilb...@interlog.com> 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

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.

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 1

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[PATCH v5 0/7] scsi_io_completion cleanup

2018-03-28 Thread Douglas Gilbert
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): scsi_io_completion comment on end_requ

[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 Gilbert <dgilb...

[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 <dgilb...@interlog.com> --- drivers/scsi/scsi_lib.c | 72 ++--- 1 file changed, 39 insertions(

[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 <dgilb...@interlog.com> --- A reviewer requested the original helper function's two retu

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thu

[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 <dgilb...@interlog.com> --- A reviewer requested the original helper function's two retu

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/scsi/scsi_lib.c | 15 --- 1 file changed, 1

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- A reviewer wanted any performance improvement (or otherwise) quantified. The improvement

[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 <dgilb...@interlog.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> -

  1   2   3   4   5   6   7   8   >