From owner-cvs-src@FreeBSD.ORG Wed Feb 28 10:19:43 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5B9316A402; Wed, 28 Feb 2007 10:19:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 74C7613C48D; Wed, 28 Feb 2007 10:19:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l1SAGWEQ090237; Wed, 28 Feb 2007 03:16:32 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 28 Feb 2007 03:16:37 -0700 (MST) Message-Id: <20070228.031637.-15687335.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86d53ufyl7.fsf@dwp.des.no> References: <200702272233.l1RMXocb004983@repoman.freebsd.org> <86d53ufyl7.fsf@dwp.des.no> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 28 Feb 2007 03:16:32 -0700 (MST) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb umass.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2007 10:19:43 -0000 In message: <86d53ufyl7.fsf@dwp.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : Warner Losh writes: : > Log: : > Some USB mass storage devices return the number of sectors in res= ponse : > to a READ_CAPACITY request rather than the maximum sector (off by= one : > problem). This causes a huge cascade of errors as the geom tasti= ng : > code tries to read the last sector (which isn't really there in t= he : > 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 i= t : > 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@. ALL ARMCHAIR GENERALS ARE HEREBY INVITED TO SUBMIT TESTED PATCHES. HAVE A NICE DAY. Warner