All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	RTE <raszilki@yandex.ru>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A
Date: Wed, 05 Dec 2007 11:04:17 +0200	[thread overview]
Message-ID: <47566991.6080200@panasas.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0712041254590.13516-100000@iolanthe.rowland.org>

On Tue, Dec 04 2007 at 20:03 +0200, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Tue, 4 Dec 2007, Boaz Harrosh wrote:
> 
>> perhaps below hunk should be added to your patch.
> 
> It looks like a good idea.
> 
>> Was it decided when this data corruption bugfix is
>> merged.
> 
> I don't know -- I haven't heard anything back from James.
> 
>> Also in sr.c. It does the range check but it might
>> enjoy the resid handling as well.
> 
> I think the range checking in sr.c is completely wrong.  The code
> doesn't check carefully to see that the error sector lies within the
> range of sectors being accessed; there's a possibility of overflow if
> the capacity is larger than 2**31 bytes.  Also this line in particular
> makes no sense:
> 
> 		error_sector &= ~(block_sectors - 1);
> 
> Like you said, using the residue value too wouldn't hurt.
> 
> Furthermore the check for the Valid bit is done wrongly:
> 
> 		if (!(SCpnt->sense_buffer[0] & 0x90))
> 
> This will never be true because of the earlier test:
> 
>         if (driver_byte(result) != 0 &&         /* An error occurred */
>             (SCpnt->sense_buffer[0] & 0x7f) == 0x70) { /* Sense current */
> 
> It probably should test against 0x80 instead of 0x90.
> 
> Alan Stern
> 
Hi Alen

Yes, I have not inspected sr.c very carefully, you are absolutely right.
Could you submit a unified patch for sd, sr and scsi.c I have hit this 
bug 2 in my error injection tests. I was doing sg_chaining tests and now
with the possibly very large requests the problem gets worse. At the time,
I could not identify the exact problem, thanks

Boaz

  reply	other threads:[~2007-12-05  9:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <op.t2a0x7tige0nj0@smtp.mail.yandex.ru>
2007-11-26 15:35 ` [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A Alan Stern
2007-11-26 15:55   ` Boaz Harrosh
2007-12-04 17:35   ` Boaz Harrosh
2007-12-04 18:03     ` Alan Stern
2007-12-05  9:04       ` Boaz Harrosh [this message]
2007-12-05 17:36         ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47566991.6080200@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=raszilki@yandex.ru \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.