public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, Alan Stern <stern@rowland.harvard.edu>
Subject: Regression fix: Generalise last_sector_bug to avoid breaking more buggy devices
Date: Thu, 24 Jul 2008 11:15:00 +0100	[thread overview]
Message-ID: <48885624.3020605@tuffmail.co.uk> (raw)

You may remember the unfortunately named "last_sector_bug" workaround. 
It was applied to the SCSI SD driver to handle certain USB cardreaders. 
Unfortunately it introduced a regression by breaking certain other buggy
USB cardreaders.

I ended up driving this fix, as the sucker who bought the second lot of
buggy hardware.  Alan Stern from USB-land said that he's happy to see
this patch merged (after fixing my logic and critiquing the patch
description).  I'm grateful for his help and everyone else who chimed in
on the usb-storage mailing list.

The patch description goes into detail.  Here's a less formal description -


The original bug causes multi-sector accesses which include the last
sector of the device to fail.  The workaround was to split such accesses
in two, so that the last sector is accessed on it's own.  The overhead
is minimal and so it was applied to all USB storage devices.

Perversely, this revealed a second bug in a different set of card
readers.  This time, failure is caused by multi-sector accesses which
stop just short of the last sector.

This suggests a systemic failure in the design/testing of USB
cardreaders, where multi-sector accesses to the last sectors are
overlooked, and fencepost errors may be common.  What follows is a
general workaround to prevent multi-sector accesses touching any of the
last 8 hardware sectors.

Thanks
Alan

                 reply	other threads:[~2008-07-24 10:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48885624.3020605@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --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