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

2016-06-07 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 = off

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: SCSI testing/USB devices are amazing

2013-05-19 Thread Douglas Gilbert
On 13-05-17 07:53 PM, ronnie sahlberg wrote: Martin, Thansk for your suggestions. On Tue, May 14, 2013 at 3:43 PM, Martin K. Petersen wrote: "Ronnie" == ronnie sahlberg writes: ... Ronnie> I have added tests for the block limits VPD as Ronnie> SCSI.Inquiry.InquiryBlockLimits. It checks tha

Re: [PATCH v3 0/6] scsi_debug: bug fixes and cleanups for data integrity support

2013-05-28 Thread Douglas Gilbert
uot; * Changes from v1 - Split the patch "fix data integrity support on highmem machine" into two separate patches. - Add new cleanup patch "reduce duplication between prot_verify_read and prot_verify_write". Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc:

Re: [PATCH v3 0/6] scsi_debug: bug fixes and cleanups for data integrity support

2013-06-02 Thread Douglas Gilbert
Split the patch "fix data integrity support on highmem machine" into two separate patches. - Add new cleanup patch "reduce duplication between prot_verify_read and prot_verify_write". Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: "Martin K. Pet

Re: [PATCH v3 0/6] scsi_debug: bug fixes and cleanups for data integrity support

2013-06-02 Thread Douglas Gilbert
On 13-06-01 10:51 PM, Akinobu Mita wrote: 2013/5/29 Martin K. Petersen : I have some patches pending as part of my next DIF/DIX update that makes some of these things more palatable at the block/SCSI level. Akinobu voiced interest in finishing the scsi_debug work on top of my code. Yes. I'm i

[Announce] sg3_utils-1.36 available

2013-06-02 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 3, 2.6 and 2.4 kernel series. It also has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and mingw). Mainly small changes and fixes in this version including s

[ANNOUNCE] sdparm 1.08 available

2013-06-09 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. Almost all CD/DVD/BD drives us

Re: [PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-24 Thread Douglas Gilbert
d once per command execution cycle. So it is not necessary to take care to decrease sdb->resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-scsi@vger.kernel.org --- * No change from v2 Ac

[PATCH] SCSI command, sense key + additional sense strings

2013-07-01 Thread Douglas Gilbert
erve in, read reservation"). Changelog: - sync SCSI command names, sense key strings and additional sense code strings with SPC-4 draft revision 36g Signed-off-by: Douglas Gilbert --- a/drivers/scsi/constants.c310 2012-12-12 06:16:21.0 -0500 +++ b/drivers/scsi/constants.c 2013-

Re: SAS Management Protocol (SMP) on Windows

2013-07-22 Thread Douglas Gilbert
On 13-07-22 04:26 AM, Hugh Chin wrote: I'm developing SMP application by Python. I've ran it on Linux, it works fine. But now I have to run it on Windows. Of course, it didn't work. So far I know that Windows seems doesn't have bsg driver. But I'm not sure. I want to know is there any way can ru

Re: [PATCH 1/4] scsi_debug: fix endianness bug in sdebug_build_parts()

2013-07-25 Thread Douglas Gilbert
ion table is not correctly initialized on big-endian systems. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-scsi@vger.kernel.org --- drivers/scsi/scsi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/s

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-07-25 Thread Douglas Gilbert
On 13-07-25 11:32 AM, vaughan wrote: On 07/23/2013 01:03 AM, Jörn Engel wrote: On Mon, 22 July 2013 12:40:29 +0800, Vaughan Cao wrote: There is a race when open sg with O_EXCL flag. Also a race may happen between sg_open and sg_remove. Changes from v4: * [3/4] use ERR_PTR series instead of a

Re: [SCSI REGRESSION] 3.10.2 or 3.10.3: arcmsr failure at bootup / early userspace transition

2013-07-29 Thread Douglas Gilbert
On 13-07-29 05:09 PM, Nix wrote: On 29 Jul 2013, Bernd Schubert uttered the following: On 07/29/2013 03:05 PM, Nix wrote: On 29 Jul 2013, Bernd Schubert said: Hi Nick, On 07/29/2013 12:10 PM, Nick Alcock wrote: arcmsr0: abort device command of scsi id = 0 lun = 1 arcmsr0: abort device comm

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-07-31 Thread Douglas Gilbert
od to me, although I didn't test it on hardware yet. Signed-off-by: Joern Engel James, care to pick this up? Acked-by: Douglas Gilbert Tested O_EXCL with multiple processes and threads; passed. sg driver prior to this patch had "leaky" O_EXCL logic according to the same test. Bloc

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-08-02 Thread Douglas Gilbert
On 13-08-01 01:01 AM, Douglas Gilbert wrote: On 13-07-22 01:03 PM, Jörn Engel wrote: On Mon, 22 July 2013 12:40:29 +0800, Vaughan Cao wrote: There is a race when open sg with O_EXCL flag. Also a race may happen between sg_open and sg_remove. Changes from v4: * [3/4] use ERR_PTR series

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-08-05 Thread Douglas Gilbert
On 13-08-04 10:19 PM, vaughan wrote: On 08/03/2013 01:25 PM, Douglas Gilbert wrote: On 13-08-01 01:01 AM, Douglas Gilbert wrote: On 13-07-22 01:03 PM, Jörn Engel wrote: On Mon, 22 July 2013 12:40:29 +0800, Vaughan Cao wrote: There is a race when open sg with O_EXCL flag. Also a race may

Re: [PATCH] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-05 Thread Douglas Gilbert
Roland, When this sg code was originally designed, there wasn't a bio in sight :-) Now I'm trying to get my head around this. We have launched a "data-in" SCSI command like READ(10) and the DMA is underway so we are waiting for a "done" indication. Instead we receive a signal interruption. It is

Re: [PATCH] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-06 Thread Douglas Gilbert
On 13-08-05 11:54 PM, Peter Chang wrote: 2013/8/5 Roland Dreier : From: Roland Dreier There is a nasty bug in the SCSI SG_IO ioctl that in some circumstances leads to one process writing data into the address space of some other random unrelated process if the ioctl is interrupted by a signal.

Re: [PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-07 Thread Douglas Gilbert
On 13-08-07 11:50 AM, Roland Dreier wrote: On Wed, Aug 7, 2013 at 7:38 AM, David Milburn wrote: I was able to succesfully test this patch overnight, I had been experimenting with the sg driver setting the BIO_NULL_MAPPED flag in sg_rq_end_io_usercontext for a orphan process which prevented th

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-08-12 Thread Douglas Gilbert
On 13-08-12 10:46 PM, vaughan wrote: On 08/06/2013 04:52 AM, Douglas Gilbert wrote: On 13-08-04 10:19 PM, vaughan wrote: On 08/03/2013 01:25 PM, Douglas Gilbert wrote: On 13-08-01 01:01 AM, Douglas Gilbert wrote: On 13-07-22 01:03 PM, Jörn Engel wrote: On Mon, 22 July 2013 12:40:29 +0800

Re: [PATCH v2] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal

2013-08-15 Thread Douglas Gilbert
On 13-08-15 12:45 PM, Roland Dreier wrote: Jens / James, do you guys plan to send this to Linus for 3.11? Triggering this bug is a bit esoteric but the impact is pretty nasty (corrupting an unrelated process). The patch is fine with me. Even though the sg driver is named in the patch title, I n

Re: [PATCH 2/4] scsi_debug: fix logical block provisioning support when unmap_alignment != 0

2013-08-20 Thread Douglas Gilbert
ch 2/4 has rather higher severity than others. This is Martin's area of expertise so I hope he also acks it. Acked-by: Douglas Gilbert 2013/7/15 Akinobu Mita : Commit b90ebc3d5c41c9164ae04efd2e4f8204c2a186f1 ("[SCSI] scsi_debug: fix logical block provisioning support") fixed se

Re: [PATCH 0/9] target: Add support for COMPARE_AND_WRITE (VAAI) emulation

2013-08-20 Thread Douglas Gilbert
On 13-08-20 05:53 PM, Nicholas A. Bellinger wrote: On Tue, 2013-08-20 at 23:29 +0200, Christoph Hellwig wrote: On Tue, Aug 20, 2013 at 08:07:51PM +, Nicholas A. Bellinger wrote: It's also currently lacking the necessary sychronization between I/O submission of COMPARE_AND_WRITE verify inst

Re: [PATCH 0/9] target: Add support for EXTENDED_COPY (VAAI) offload emulation

2013-08-23 Thread Douglas Gilbert
On 13-08-23 04:26 AM, Nicholas A. Bellinger wrote: From: Nicholas Bellinger Hi folks! This series adds support to target-core for generic EXTENDED_COPY offload emulation as defined by SPC-4 using virtual (IBLOCK, FILEIO, RAMDISK) backends. EXTENDED_COPY is a VMWare ESX VAAI primative that is

Re: [PATCH 0/9] target: Add support for EXTENDED_COPY (VAAI) offload emulation

2013-08-23 Thread Douglas Gilbert
On 13-08-23 02:33 PM, Martin K. Petersen wrote: "Doug" == Douglas Gilbert writes: Doug> The SCSI opcodes associated with it (0x83 and 0x84) have been Doug> renamed THIRD PARTY COPY OUT and IN, and Where did you see that? My SPC still has EXTENDED COPY. SCSI _opcodes_ =

Re: [PATCH v5 0/4] [SCSI] sg: fix race condition in sg_open

2013-08-27 Thread Douglas Gilbert
On 13-08-27 10:16 AM, vaughan wrote: On 08/13/2013 11:16 AM, Douglas Gilbert wrote: On 13-08-12 10:46 PM, vaughan wrote: On 08/06/2013 04:52 AM, Douglas Gilbert wrote: On 13-08-04 10:19 PM, vaughan wrote: On 08/03/2013 01:25 PM, Douglas Gilbert wrote: On 13-08-01 01:01 AM, Douglas Gilbert

Re: PATCH: scsi: make scsi reset permissions more relaxed (RFC)

2013-08-30 Thread Douglas Gilbert
On 13-08-30 02:04 PM, Marcus Meissner wrote: Hi folks, cdrecord wants to whack the CD drive with a SCSI RESET ... So far SCSI RESET can be done at 4 levels (target, device, bus, host) and all 4 are checked for CAP_SYS_ADMIN / CAP_SYS_RAWIO. As the cdrecord author wants special permissions for

Re: [PATCH 0/4] Hyper-V TRIM support

2013-09-13 Thread Douglas Gilbert
On 13-09-13 08:58 AM, Andy Whitcroft wrote: tl;dr -- enable TRIM support for Hyper-V emulated disks. The Hyper-V hypervisor can support TRIM for its devices, advertising this via the appropriate VPD pages. However the emulated disks only claim to be SPC-2 devices. According to the specs VPD pa

[PATCH] sg: relax 16 byte cdb restriction

2013-09-17 Thread Douglas Gilbert
way as the bsg driver. Remove comment from sg.h public interface about the cmd_len field being limited to 16 bytes. Signed-off-by: Douglas Gilbert diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 5cbc4bb..c46d4b2 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@

Re: Bypass block layer and Fill SCSI lower layer driver queue

2013-09-18 Thread Douglas Gilbert
On 13-09-18 03:58 AM, Jack Wang wrote: On 09/18/2013 08:41 AM, Alireza Haghdoost wrote: Hi I am working on a high throughput and low latency application which does not tolerate block layer overhead to send IO request directly to fiber channel lower layer SCSI driver. I used to work with libaio

Re: SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-21 Thread Douglas Gilbert
On 13-09-20 06:03 PM, Martin K. Petersen wrote: "Mike" == Mike Snitzer writes: Mike, Mike> AFAIK the reason for these heuristics is: devices that do support Mike> WRITE SAME cannot properly report as much because they don't Mike> support REPORT SUPPORTED OPERATION CODES -- this lack of RSOC M

Re: [dm-devel] SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-24 Thread Douglas Gilbert
On 13-09-24 03:12 PM, Jeremy Linton wrote: On 9/24/2013 12:39 AM, Hannes Reinecke wrote: My drives support 'report opcodes', and report that write same is supported: ... 93 16Write same(16) ... but no support for page 'b0'. And yes, these are real SAS drives. So t

Re: SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-25 Thread Douglas Gilbert
On 13-09-25 04:52 PM, Bernd Schubert wrote: On 09/24/2013 03:49 PM, Martin K. Petersen wrote: "Mike" == Mike Snitzer writes: Mike> So are there drives like this?: Mike> 1) don't support RSOC Mike> 2) do support WRITE SAME Mike> 3) do populate VPD page with either WRITE SAME w/ discard bit set

Re: SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-25 Thread Douglas Gilbert
On 13-09-25 08:44 PM, Martin K. Petersen wrote: "Bernd" == Bernd Schubert writes: Hey Bernd, Bernd> I'm afraid we have another problem. I'm currently working on to Bernd> get discard working for our LSI2008 HBAs with attached sata-SSDs Bernd> and the heuristics in sd_read_write_same with base

Re: SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-26 Thread Douglas Gilbert
On 13-09-26 10:42 AM, Martin K. Petersen wrote: "Bernd" == Bernd Schubert writes: Bernd, Bernd> Both types of systems we have in-house neither block limits vpd Bernd> nor READ_CAP16 return anything that would indicate discard is Bernd> supported. But UNMAP and WRITE SAME unmap(*) just work fi

[PATCH] sg: fix memory leaks

2013-09-26 Thread Douglas Gilbert
procfs and sysfs. The patch is generated from lk 3.12.0-rc2 . Signed-off-by: Douglas Gilbert diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 5cbc4bb..aa86276 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2060,6 +2060,7 @@ sg_add_sfp(Sg_device * sdp, int dev

Re: [PATCH 07/10] hpsa: hide logical drives with format in progress from linux

2013-09-27 Thread Douglas Gilbert
On 13-09-27 10:41 AM, scame...@beardog.cce.hp.com wrote: On Fri, Sep 27, 2013 at 04:01:30PM +0200, Tomas Henzl wrote: On 09/27/2013 03:34 PM, scame...@beardog.cce.hp.com wrote: On Fri, Sep 27, 2013 at 03:22:19PM +0200, Tomas Henzl wrote: On 09/23/2013 08:34 PM, Stephen M. Cameron wrote: From:

Re: Odd behavior of a "SAS-2" backplane with SGPIO commands

2013-10-03 Thread Douglas Gilbert
On 13-10-03 03:11 PM, Pasi Kärkkäinen wrote: On Mon, Sep 02, 2013 at 05:44:35PM +0300, Pasi Kärkkäinen wrote: On Sun, Sep 01, 2013 at 08:13:02PM +0300, Pasi Kärkkäinen wrote: On Fri, Aug 30, 2013 at 05:38:04PM -0400, Rich wrote: Apparently, only about 4 months. P17 firmware is out.

[LSF/MM TOPIC] Storage tools

2015-01-15 Thread Douglas Gilbert
I have written and continue to maintain several user space packages used for the SCSI and ATA subsystems. These include sg3_utils (a collection of tools), lsscsi, sdparm, ddpt and smp_utils. I also maintain the Linux scsi_debug driver which may be viewed as a test tool rather than a production dri

Re: [PATCH] scsi_debug: test always evaluates to false, || should be used instead

2015-01-22 Thread Douglas Gilbert
presented this fix twice already. Most recently in "[PATCH] [RESEND] scsi_debug: fix sanity check in resp_rsup_opcodes" 20150102. So one more time, with feeling: Acked-by: Douglas Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body

Re: [PATCH 03/17] sg: Remove an unused variable

2015-01-23 Thread Douglas Gilbert
On 15-01-23 01:07 PM, Bart Van Assche wrote: Signed-off-by: Bart Van Assche Acked-by: Douglas Gilbert --- drivers/scsi/sg.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index b14f64c..a668c88 100644 --- a

Re: [PATCHv2 5/5] scsi: move scsi/sg.h to uapi/linux/sg.h

2015-01-30 Thread Douglas Gilbert
On 15-01-29 07:56 PM, Andy Grover wrote: This will enable user programs to have access to the most current definitions. The above description is a bit too generic. At the moment many user space programs in Linux access the SG_IO ioctl related declarations with: #include I suspect that fi

Re: CONFIG_SCSI_MQ_DEFAULT cause slow direct write speed to usb stick

2015-02-10 Thread Douglas Gilbert
On 15-02-10 01:50 PM, Andrej Gelenberg wrote: Hi, i had found a problem with CONFIG_SCSI_MQ_DEFAULT config option. If it activated, then the write speeds to the /dev/sd* of an usb stick drops dramatically: it's only about 250 kb/CONFIG_SCSI_MQ_DEFAULTs, but should be about 7 Mb/s. Git bisect als

Re: [PATCH] [SCSI] sg: fix read() error reporting

2015-02-11 Thread Douglas Gilbert
On 15-02-11 11:32 AM, Tony Battersby wrote: Fix SCSI generic read() incorrectly returning success after detecting an error. Cc: Signed-off-by: Tony Battersby --- For inclusion in kernel 3.20. --- linux-3.19.0/drivers/scsi/sg.c.orig 2015-02-08 21:54:22.0 -0500 +++ linux-3.19.0/drivers

Re: [PATCH] [SCSI] sg: fix read() error reporting

2015-02-12 Thread Douglas Gilbert
On 15-02-11 01:13 PM, Tony Battersby wrote: On 02/11/2015 12:45 PM, Douglas Gilbert wrote: On 15-02-11 11:32 AM, Tony Battersby wrote: Fix SCSI generic read() incorrectly returning success after detecting an error. Cc: Signed-off-by: Tony Battersby --- For inclusion in kernel 3.20

Re: [PATCH v2 1/2] [SCSI] sg: fix unkillable I/O wait deadlock with scsi-mq

2015-02-13 Thread Douglas Gilbert
ead of waiting for userspace to call read(). Cc: Douglas Gilbert Cc: # 3.17+ Signed-off-by: Tony Battersby --- For inclusion in kernel 3.20. This is the exact same patch as before; I have only updated the patch description to reflect new details uncovered by myself and Douglas Gilbert. There i

Re: [PATCH v2 1/2] [SCSI] sg: fix unkillable I/O wait deadlock with scsi-mq

2015-02-15 Thread Douglas Gilbert
ead of waiting for userspace to call read(). Cc: Douglas Gilbert Cc: # 3.17+ Signed-off-by: Tony Battersby Acked-by: Douglas Gilbert Tested-by: Douglas Gilbert For inclusion in kernel 3.20. This is the exact same patch as before; I have only updated the patch description to reflect new d

Re: [PATCH v2 2/2] [SCSI] sg: fix EWOULDBLOCK errors with scsi-mq

2015-02-15 Thread Douglas Gilbert
potential deadlock, this patch should be applied after the patch titled "sg: fix unkillable I/O wait deadlock with scsi-mq". Cc: Douglas Gilbert Cc: # 3.17+ Signed-off-by: Tony Battersby Acked-by: Douglas Gilbert Tested-by: Douglas Gilbert For inclusion in kernel 3.20. The dif

Re: [PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage

2015-02-22 Thread Douglas Gilbert
On 15-02-22 11:41 AM, Christoph Hellwig wrote: On Sat, Feb 14, 2015 at 03:27:40AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger This patch adds a sbc_check_dpofua() function that performs sanity checks for DPO/FUA command bits. It introduces checks to fail when either bit is se

Re: [PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage

2015-02-22 Thread Douglas Gilbert
On 15-02-22 03:44 PM, James Bottomley wrote: On Sun, 2015-02-22 at 15:19 -0500, Douglas Gilbert wrote: On 15-02-22 11:41 AM, Christoph Hellwig wrote: On Sat, Feb 14, 2015 at 03:27:40AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger This patch adds a sbc_check_dpofua() function

Re: [scsi 1/2] scsi_debug: schedule_resp fix input variable check

2015-02-23 Thread Douglas Gilbert
On 15-02-23 06:13 AM, Tomas Winkler wrote: The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 11 +-- 1 file

Re: [PATCH] scsi_debug: check for bigger value first

2015-02-23 Thread Douglas Gilbert
On 15-01-06 04:03 PM, Andy Shevchenko wrote: Even for signed types we have to check for bigger positive value first. Otherwise it will be never happened. Signed-off-by: Andy Shevchenko Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH 1/3] SCSI-debug: Deletion of unnecessary checks before the function call "vfree"

2015-02-23 Thread Douglas Gilbert
Elfring Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 1132321..9e4add7 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi

Re: [PATCH 2/3] SCSI-debug: Less function calls in scsi_debug_init() after error detection

2015-02-23 Thread Douglas Gilbert
tained null pointers eventually. This implementation detail could be improved by the introduction of two jump labels. Signed-off-by: Markus Elfring Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH 3/3] SCSI-debug: Fix exception handling for an alignment/granularity mismatch in scsi_debug_init()

2015-02-23 Thread Douglas Gilbert
ing by replacing the return statement by a goto statement so that previously allocated resources will also be appropriately released. Signed-off-by: Markus Elfring Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drive

Re: [PATCH 4/4] scsi_debug: make dump_sector static

2015-02-23 Thread Douglas Gilbert
On 15-02-18 05:31 PM, Tomas Winkler wrote: fixes warning: warning: no previous prototype for ‘dump_sector’ Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c

Re: [PATCH 1/4] scsi_debug: define pr_fmt() for consistent logging

2015-02-23 Thread Douglas Gilbert
On 15-02-18 05:31 PM, Tomas Winkler wrote: Use pr_fmt with both module name and __func__ Also drop few bare printk leftovers The log format should stay pretty much intact Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 118

Re: [PATCH 2/4] scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS;

2015-02-23 Thread Douglas Gilbert
On 15-02-18 05:31 PM, Tomas Winkler wrote: use SCSI_W_LUN_REPORT_LUNS from scsi.h instead of localy defined SAM2_WLUN_REPORT_LUNS Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions

Re: [PATCH 3/4] scsi_debug: vfree is null safe so drop the check

2015-02-23 Thread Douglas Gilbert
On 15-02-18 05:31 PM, Tomas Winkler wrote: Signed-off-by: Tomas Winkler James and Christoph, Please ignore this patch. I have just acked a more comprehensive patch on this code from SF Markus Elfring. Doug Gilbert --- drivers/scsi/scsi_debug.c | 10 +++--- 1 file changed, 3 insertion

Re: [scsi 1/2 V2] scsi_debug: schedule_resp fix input variable check

2015-02-23 Thread Douglas Gilbert
On 15-02-23 10:18 AM, Tomas Winkler wrote: The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Cc: Douglas Gilbert Signed-off-by: Tomas Winkler Acked-by: Dougl

Re: [scsi 2/2] scsi_debug: fix REPORT LUNS Well Known LU

2015-02-23 Thread Douglas Gilbert
S + 1; Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index f032aac75997..2c49ddd8d18b 100644 --- a/drivers/scsi/scsi_debug

Re: [PATCH] sg: fix overflow in timeout calculation

2015-02-23 Thread Douglas Gilbert
On 15-02-09 01:45 PM, Mikulas Patocka wrote: USER_HZ may be greater than HZ and in that case arithmetics tries to calculate the maximum accepted timeout overflows. We need to use INT_MAX in this case. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org Acked-by: Douglas Gilbert

Re: [PATCH] scsi_debug: rework resp_report_luns

2015-02-24 Thread Douglas Gilbert
On 15-02-24 04:37 PM, Tomas Winkler wrote: 1. Fix the error check: the alloc length should be > 16 and not > 4 You are proposing to make a marginally incorrect test completely incorrect! The governing rule for almost all "allocation length" fields in SCSI commands (that return data-in) is: "A

Re: [PATCH] scsi_debug: rework resp_report_luns

2015-02-25 Thread Douglas Gilbert
On 15-02-25 02:54 AM, Winkler, Tomas wrote: On 15-02-24 04:37 PM, Tomas Winkler wrote: 1. Fix the error check: the alloc length should be > 16 and not > 4 You are proposing to make a marginally incorrect test completely incorrect! Quoting from the spec: The great thing about standards is t

Re: [libsas] Kernel Crash in smp_execute_task

2015-03-04 Thread Douglas Gilbert
On 15-03-04 06:29 PM, Praveen Murali wrote: On second thoughts, should we even let smp commands/requests thru for sas end devices (dev->dev_type == SAS_END_DEV) ? if so, wont the following patch more sense? (also, in my last mail the kernel logs were all messed up; sorry dint realize that when

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

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 c

[PATCH] scsi_debug: fix prevent_allow+verify regressions

2015-04-06 Thread Douglas Gilbert
- same fix for VERIFY(10) Signed-off-by: Douglas Gilbert --- 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, F_INV_OP

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

Re: [Bug] Remove and add a mounted device gets a new dev path

2012-12-09 Thread Douglas Gilbert
On 12-12-10 03:00 PM, Anand Jain wrote: # mount /dev/sdb /btrfs # echo "scsi remove-single-device 1 0 0 0" > /proc/scsi/scsi # lsscsi [0:0:0:0]diskATA VBOX HARDDISK1.0 /dev/sda [2:0:0:0]diskATA VBOX HARDDISK1.0 /dev/sdc # btrfs su create /btrfs/sv1 C

Re: [PATCH] [SCSI] scsi_debug: fix deadlock on module unload, also complete queued commands

2012-12-12 Thread Douglas Gilbert
d deadlock. Also changed to complete all queued commands if scsi_debug is unloaded instead of discarding them, because the requests would eventually timeout after the module was gone. Signed-off-by: Ewan D. Milne Acked-by: Douglas Gilbert -- To unsubscribe from this list: send the line &q

Re: [PATCH 0/2] Change type-2 dif to use rq embedded 32 byte cdb

2012-12-29 Thread Douglas Gilbert
On 12-12-19 05:34 AM, Scott Guthridge wrote: The patch we suggested where we simply changed BLK_MAX_CDB and MAX_COMMAND_SIZE from 16 to 32 was meant to be a "stick in the sand". It's the simplest description of the functionality we're looking for. Other approaches that accomplish the same thi

[Announce] sg3_utils-1.35 available

2013-01-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 kernel (lk) 3, 2.6 and lk 2.4 series. It also has ports to FreeBSD, Tru64, Solaris, and Windows (cygwin and mingw). This version adds sg_compare_and_write (contribute

Re: [PATCH RFC 8/9] [SCSI] Add sense and Unit Attention generation to scsi_debug

2013-01-19 Thread Douglas Gilbert
On 13-01-18 11:27 AM, Ewan D. Milne wrote: From: "Ewan D. Milne" Added capability to scsi_debug to generate sense and Unit Attention conditions to exercise the enhanced sense and Unit Attention handling. Signed-off-by: Ewan D. Milne --- drivers/scsi/scsi_debug.c | 133 ++

Re: [PATCH RFC 1/9] [SCSI] Detect overflow of sense data buffer

2013-01-21 Thread Douglas Gilbert
On 13-01-21 02:26 AM, Hannes Reinecke wrote: On 01/18/2013 05:46 PM, James Bottomley wrote: On Fri, 2013-01-18 at 11:27 -0500, Ewan D. Milne wrote: --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -241,6 +241,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) if (!

Re: [PATCH] SG_SCSI_RESET ioctl should only perform requested operation

2013-02-04 Thread Douglas Gilbert
On 13-02-04 03:17 PM, Jeremy Linton wrote: From all the documentation I've found, it is not clear that users of the SG_SCSI_RESET ioctl may have their requests progress up the hierarchy of reset operations. Basically, requests for a SCSI_TRY_RESET_DEVICE may eventually result in a TARGET, BUS,

Re: [PATCH] scsi_debug: Fix endianess in partition table

2013-02-12 Thread Douglas Gilbert
On 13-02-12 04:03 AM, Martin Peschke wrote: On Mon, 2013-02-11 at 18:34 +0100, Martin Peschke wrote: Both start_sect and nr_sects in struct partition are __le32 and require cpu_to_le32() on assignment. Steffen Maier has pointed me at: block/partitions/msdos.c: return (sector_t)get_unali

Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-13 Thread Douglas Gilbert
On 13-02-13 03:32 AM, Paolo Bonzini wrote: Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed for MMC devices (roughly, "play/burn CDs without requ

Re: [PATCH] scsi_debug: Fix endianess in partition table

2013-02-13 Thread Douglas Gilbert
s390x look like the ones generated on my laptop. Signed-off-by: Martin Peschke Reviewed-by: Steffen Maier Acked-by: Douglas Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at ht

Re: [PATCH] [SCSI] scsi_debug: Do not respond to INQUIRY commands with CHECK CONDITION when sense pending

2013-02-14 Thread Douglas Gilbert
On 13-02-14 11:36 AM, Ewan D. Milne wrote: From: "Ewan D. Milne" According to SPC, INQUIRY commands are not supposed to respond with a CHECK CONDITION due to a pending UNIT ATTENTION. This was causing failures when re-scanning a scsi_debug target. Good pick up. Reference: sam5r12.pdf section

Re: [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending

2013-02-15 Thread Douglas Gilbert
re INQUIRY and REPORT LUNS. Signed-off-by: Ewan D. Milne Acked-by: Douglas Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Douglas Gilbert
scsi_reset_provider() in the scsi_error.c file in a similar way to support this new functionality. Signed-off-by: Douglas Gilbert diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index c1b05a8..4ba79c1 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2013,8 +2

Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Douglas Gilbert
On 13-02-15 04:48 PM, Mike Christie wrote: On 02/15/2013 01:39 PM, Douglas Gilbert wrote: Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should only perform requested operation" by Jeremy Linton a patch is presented that adds "no_escalate" versions to the existin

[PATCH v2] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-16 Thread Douglas Gilbert
device->target->bus->host escalation does not occur. The SG_SCSI_RESET ioctl is modified in both the sg driver and scsi_ioctl.c (so block devices can use it). - modify scsi_reset_provider() in the scsi_error.c file in a similar way to support this additional functionality.

Re: WARNING: at drivers/ata/libata-core.c:5049 ata_qc_issue+0x1c7/0x3a0()

2013-02-19 Thread Douglas Gilbert
On 13-02-19 01:37 PM, Tommi Rantala wrote: Hello, Hit this WARNING once while fuzzing the kernel with trinity in a qemu virtual machine as the root user. Does this make any sense? I have occasionally seen some ATA related troubles while fuzzing in a VM, but this warning is new to me. [ 490.71

Re: WARNING: at drivers/ata/libata-core.c:5049 ata_qc_issue+0x1c7/0x3a0()

2013-02-19 Thread Douglas Gilbert
On 13-02-19 04:52 PM, Dave Jones wrote: On Tue, Feb 19, 2013 at 04:04:33PM -0500, Douglas Gilbert wrote: > On 13-02-19 01:37 PM, Tommi Rantala wrote: > > Hello, > > > > Hit this WARNING once while fuzzing the kernel with trinity in a qemu > > virtu

Re: Issue with mini-SaS to eSATA to USB 3.0 setup

2013-02-21 Thread Douglas Gilbert
On 13-02-21 02:26 PM, Sarah Sharp wrote: Cc-ing the SCSI and USB storage list. Folks, does the attached picture look like a sane setup? I've never used mini-SaS to eSATA adapter before, let alone with four eSATA to USB 3.0 adapters. Well SAS to eSATA is okay (works for me: LSI SAS9212-4i4e HB

Re: [PATCH 0/4] scsi: 64-bit LUN support

2013-02-25 Thread Douglas Gilbert
On 13-02-21 11:32 AM, James Bottomley wrote: On Thu, 2013-02-21 at 16:15 +, Elliott, Robert (Server Storage) wrote: Regarding changes like this: - printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%d] " + printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%llu] "

Re: [PATCH 2/4] scsi: use 64-bit LUNs

2013-02-25 Thread Douglas Gilbert
On 13-02-25 10:33 AM, Steffen Maier wrote: Hi Hannes, I like the idea and most of the patch set, so I only have a few questions left and some review comments below. Just curious: Do you also plan to adapt systemd/udev, especially path_id for fc transport with its open coded copy of int_to_scs

Re: [GIT PULL] Final round of SCSI updates for the 3.8+ merge window

2013-03-01 Thread Douglas Gilbert
What is the status of the: - scsi: 64-bit LUN support [v2] - SG_SCSI_RESET ioctl: add no_escalate values [v2] patches? Doug Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vg

Re: [GIT PULL] Final round of SCSI updates for the 3.8+ merge window

2013-03-01 Thread Douglas Gilbert
On 13-03-01 10:27 AM, Jeremy Linton wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/1/2013 9:06 AM, James Bottomley wrote: The results were "interesting", there are some really strange things that happen in some of the LLD error paths. Its obvious that error injection is not part of

Re: [PATCH 1/4] scsi_scan: Fixup scsilun_to_int()

2013-03-04 Thread Douglas Gilbert
On 13-02-20 08:47 AM, Hannes Reinecke wrote: scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque value. Signed-o

lsscsi and sg3_utils betas for testing 64 bit LUNs

2013-03-06 Thread Douglas Gilbert
To facilitate testing Linux 64 bit LUNs (the kernel holds only 32 bit LUNs internally at the moment), I have put up beta versions of lsscsi and the sg3_utils packages, see the top of this page: http://sg.danny.cz/sg/ lsscsi version 0.27 (beta 1) adds a --lunhex (-x) option, here is an example of

Re: lsscsi and sg3_utils betas for testing 64 bit LUNs

2013-03-06 Thread Douglas Gilbert
On 13-03-06 10:10 AM, Douglas Gilbert wrote: To facilitate testing Linux 64 bit LUNs (the kernel holds only 32 bit LUNs internally at the moment), I have put up beta versions of lsscsi and the sg3_utils packages, see the top of this page: http://sg.danny.cz/sg/ lsscsi version 0.27 (beta 1) adds

Re: [PATCH v2][RFC] scsi_transport_fc: Implement I_T nexus reset

2013-03-07 Thread Douglas Gilbert
On 13-03-07 03:13 PM, Jeremy Linton wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/7/2013 1:19 PM, Mike Christie wrote: What happens for lpfc? It seems __fc_remote_port_delete ends up calling the fast io fail code right away and that sets FC_RPORT_FAST_FAIL_TIMEDOUT. We will then cal

Re: [patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-08 Thread Douglas Gilbert
On 13-03-08 07:02 AM, Dan Carpenter wrote: Static checkers complain that this allocation isn't checked. We should return zero if the allocation fails. Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 1b68142..a022997 100644

Re: [patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-08 Thread Douglas Gilbert
On 13-03-08 05:50 PM, James Bottomley wrote: On Fri, 2013-03-08 at 12:57 -0500, Douglas Gilbert wrote: On 13-03-08 07:02 AM, Dan Carpenter wrote: Static checkers complain that this allocation isn't checked. We should return zero if the allocation fails. Signed-off-by: Dan Carpenter

Re: [patch] [SCSI] scsi_transport_sas: check for allocation failure

2013-03-11 Thread Douglas Gilbert
On 13-03-11 09:10 AM, Dan Carpenter wrote: On Fri, Mar 08, 2013 at 10:50:19PM +, James Bottomley wrote: On Fri, 2013-03-08 at 12:57 -0500, Douglas Gilbert wrote: On 13-03-08 07:02 AM, Dan Carpenter wrote: Static checkers complain that this allocation isn't checked. We should return

Re: [PATCH][RFC] scsi: Use W_LUN for scanning

2013-03-15 Thread Douglas Gilbert
On 13-03-15 05:46 AM, Hannes Reinecke wrote: SAM advertises the use of a Well-known LUN (W_LUN) for scanning. As this avoids exposing LUN 0 (which might be a valid LUN) for all initiators it is the preferred method for LUN scanning on some arrays. So we should be using W_LUN for scanning, too. If

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