public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
	Oliver Neukum <oliver@neukum.org>,
	Sergey Dolgov <solkaa@gmail.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: usb-storage, error reading the last 8 sectors, regression in 2.6.25-rc7
Date: Wed, 02 Apr 2008 09:01:35 +0200	[thread overview]
Message-ID: <47F32F4F.2030702@hhs.nl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0804011659500.9362-100000@netrider.rowland.org>

Alan Stern wrote:
> On Tue, 1 Apr 2008, Hans de Goede wrote:
> 
>> Reverting the patch is easy, edit drivers/usb/storage/scsiglue.c and remove the 
>> following line:
>> "                sdev->last_sector_bug = 1;"
>>
>> Which should be close to line 193 (it is 193 in my source tree, but thats a bit 
>> stale).
>>
>>> The old way was not necessarily correct for this type of device bug. Only
>>> that it had a very high chance of not appearing.
>>>
>>> When discussing the last bug, it was said to enable it by default for USB
>>> instead of using blacklists. It looks like this bug, or the other, needs a
>>> blacklist.
>>>
>> If the splitting of the request is the cause, yes then it looks like that.
>>
>>> But to me it looks like this is a 4k thing. I think Windows will always
>>> use 4k for FAT, though never triggering either of the bugs.
>>>
>> I'm pretty sure the last sector must only be read by itself bug (for lack of a 
>> better name) is present under windows too, but won't be triggered as windows 
>> normally doesn't access the last sector, where as various pieces of Linux 
>> routinely probe the end of the disk, for detection of exotic partition types/ 
>> disklabes.etc.
>>
>>> The one submitting the last sector patch was, I think, Hans de Goede (CCed)
>>> Hans ?
>> Correct I wrote the split up requests which touch the last sector changes to 
>> the scsi disk handling, and a seperate patch to always set the flag which 
>> enables the splitting for usb disks.
>>
>>>   If I read last 8 sectors (4k) on a device that exhibits the "last sector bug"
>>>   Does it work? (Is 8 a magic number here)
>>>
>> I just tried and I'm afraid not, an 8 sector read which includes at the last 
>> sector completely kills the device, no other transfers to / from the device 
>> will work until the sdcard is removed and reinserted (the troublesome device is 
>> a card reader build into a multi function printer, one gets what one pays for).
> 
> It sounds like the last_sector_bug setting should be conditional on a 
> blacklist entry.  As far as I know it affects only a small proportion 
> of devices; most are fine with multi-sector reads at the end.
> 

Maybe we should first determine that the regression is _really_ caused by this?

When testing yesterday I did a printk of any (unmodified) reads which would 
touch the last sector and quite a few where not 8 sector reads, so if this 
devices goes barf on any last sector including read of a different size then 8, 
it will have troubles without the work around too.

First we need to determine what _exactly_ causes this device to become unhappy 
(which should be trivial to test through dd), if I understand things sofar, the 
device doesn't like if a read is done which stops one sector short of the last 
sector. Such  a read being done could happen without my split requests code 
too, so making that conditional then wouldn't do any good, it would only make 
the bug (much) less likely to get triggered, but it could still happen en 
probably be reproduced by a trivial dd command.

Regards,

Hans


  reply	other threads:[~2008-04-02  7:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-30  7:49 usb-storage, error reading the last 8 sectors, regression in 2.6.25-rc7 Sergey Dolgov
2008-03-30 18:59 ` Alan Stern
2008-03-30 22:32   ` Sergey Dolgov
2008-04-01  1:18     ` Sergey Dolgov
2008-04-01  1:58       ` Alan Stern
2008-04-01  7:38         ` Oliver Neukum
2008-04-01 14:28           ` Alan Stern
2008-04-01 14:34             ` Matthew Dharm
2008-04-01 14:42               ` Alan Stern
2008-04-01 15:26                 ` Boaz Harrosh
2008-04-01 15:53                 ` Matthew Dharm
2008-04-01 16:31                   ` Boaz Harrosh
2008-04-01 20:24                     ` Hans de Goede
2008-04-01 21:01                       ` Alan Stern
2008-04-02  7:01                         ` Hans de Goede [this message]
2008-04-02 14:15                           ` Alan Stern
2008-04-01 16:48                   ` Sergey Dolgov
  -- strict thread matches above, loose matches on Subject: below --
2008-04-03 22:49 2.6.25-rc8-git2: Reported regressions from 2.6.24 Rafael J. Wysocki
2008-04-03 23:22 ` usb-storage, error reading the last 8 sectors, regression in 2.6.25-rc7 Rafael J. Wysocki

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=47F32F4F.2030702@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --cc=bharrosh@panasas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=solkaa@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox