[PATCH v2] scsi_debug: randomize command duration option + %p

2019-09-27 Thread Douglas Gilbert
Add an option to use the given command delay (in nanoseconds) as the upper limit for command durations. A pseudo random number generator chooses each duration from the range: [0..delay_in_ns) Main benefit: allows testing with out-of-order responses. Change the only %p (print a kernel pointe

Re: [PATCH 0/2] Fix SCSI & USB Storage CHECK CONDITION handling

2019-09-27 Thread Alan Stern
On Thu, 26 Sep 2019, Douglas Gilbert wrote: > On 2019-09-26 7:57 p.m., Alan Stern wrote: > > PS: The correct term is "residue", not "residual". I know that the > > code sometimes uses the wrong word. > > Digging into my T10 document archive I found this cam3r03.pdf : > >− cam_resid; >

Re: [RFC,v2] scsi: scan: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT

2019-09-27 Thread Hannes Reinecke
On 9/27/19 1:26 AM, Martin K. Petersen wrote: > > Andrey, > This patch break exposing individual RAID disks from adaptec raid controller. I need access to this disc's for S.M.A.R.T monitoring. >> >> adaptec report hidden luns with PQ=1, PDT=0 - now it skipped. > Please find other

Re: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6

2019-09-27 Thread Andrea Vai
Il giorno mer, 25/09/2019 alle 21.36 +0200, Jens Axboe ha scritto: > On 9/25/19 9:30 PM, Alan Stern wrote: > [...] > > > > I have attached the two patches to this email. You should start > with a > > recent kernel source tree and apply the patches by doing: > > > > git apply patch1 patch2 >

Re: [PATCH 0/2] Fix SCSI & USB Storage CHECK CONDITION handling

2019-09-27 Thread Alan Stern
On Fri, 27 Sep 2019, Damien Le Moal wrote: > On 2019/09/26 16:57, Alan Stern wrote: > > On Fri, 27 Sep 2019, Damien Le Moal wrote: > > > >> If a non-passthrough command is terminated with a CHECK CONDITION, the > >> scsi error recovery code reuses the failed command scsi_cmnd structure > >> to pr

Re: [PATCH 1/2] scsi: save/restore command resid for error handling

2019-09-27 Thread Christoph Hellwig
On Fri, Sep 27, 2019 at 07:08:43AM +0900, Damien Le Moal wrote: > When a command is terminated with CHECK CONDITION and request sense > executed by hijacking the command descriptor, the original command resid > is lost and replaced with the resid from the execution of request sense. > If based on t

Re: [PATCH 0/2] Fix SCSI & USB Storage CHECK CONDITION handling

2019-09-27 Thread Damien Le Moal
On 2019/09/27 9:34, Alan Stern wrote: > On Fri, 27 Sep 2019, Damien Le Moal wrote: > >> On 2019/09/26 16:57, Alan Stern wrote: >>> On Fri, 27 Sep 2019, Damien Le Moal wrote: >>> If a non-passthrough command is terminated with a CHECK CONDITION, the scsi error recovery code reuses the fai

[PATCH V2] scsi: save/restore command resid for error handling

2019-09-27 Thread Damien Le Moal
When a non-passthrough command is terminated with CHECK CONDITION, request sense is executed by hijacking the command descriptor. Since scsi_eh_prep_cmnd() and scsi_eh_restore_cmnd() do not save/restore the original command resid, the value returned on failure of the original command is lost and re

Re: [PATCH 0/2] Fix SCSI & USB Storage CHECK CONDITION handling

2019-09-27 Thread Finn Thain
[snipped selective measurements of word usage] On Fri, 27 Sep 2019, Alan Stern wrote: > > So I guess this was never defined precisely. > The O.E.D. defines these terms: residual a. [...] n. 1. a quantity remaining after other things have been subtracted