cvs commit: src/sys/dev/usb umass.c

M. Warner Losh imp at bsdimp.com
Wed Feb 28 10:19:43 UTC 2007


In message: <86d53ufyl7.fsf at dwp.des.no>
            des at des.no (Dag-Erling Smørgrav) writes:
: Warner Losh <imp at FreeBSD.org> writes:
: >   Log:
: >   Some USB mass storage devices return the number of sectors in response
: >   to a READ_CAPACITY request rather than the maximum sector (off by one
: >   problem).  This causes a huge cascade of errors as the geom tasting
: >   code tries to read the last sector (which isn't really there in the
: >   face of this error).  automated tools that manipulate disk labels and
: >   such also have issues.
: >   
: >   Create a new quirk READ_CAPACITY_OFFBY1 and add a quirk for the
: >   SanDISK ImageMate that I have that suffers from this problem (the
: >   SDDR-31).  It intercepts the READ_CAPACITY response and adjusts it
: >   from number of sectors to max sector for devices with this quirk.
: >   
: >   Reading the Linux source suggests that there are a host of
: >   other devices with this issue, including iPods and some popular
: >   cameras.  I've not added quirks for them, since I don't have the
: >   devices in front of me to test.
: 
: How about the following dirty hack: if the appropriate kernel option /
: device hint / sysctl knob is frobbed, when a READ_CAPACITY request
: completes, try to read the last sector, and if that doesn't work,
: adjust the result and print a warning to the console?

HOW ABOUT PEOPLE SUBMIT PATCHES RATHER THAN SUGGEST MORE WORK FOR ME.
I ALREADY DISCUSSED THIS IN SCSI at .  ALL ARMCHAIR GENERALS ARE HEREBY
INVITED TO SUBMIT TESTED PATCHES.

HAVE A NICE DAY.

Warner



More information about the cvs-all mailing list