From owner-cvs-src@FreeBSD.ORG Tue Feb 27 22:33:50 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 DC77E16A400; Tue, 27 Feb 2007 22:33:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id CDD0A13C4A5; Tue, 27 Feb 2007 22:33:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1RMXofX004985; Tue, 27 Feb 2007 22:33:50 GMT (envelope-from imp@repoman.freebsd.org) Received: (from imp@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1RMXocb004983; Tue, 27 Feb 2007 22:33:50 GMT (envelope-from imp) Message-Id: <200702272233.l1RMXocb004983@repoman.freebsd.org> From: Warner Losh Date: Tue, 27 Feb 2007 22:33:50 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: 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: Tue, 27 Feb 2007 22:33:51 -0000 imp 2007-02-27 22:33:50 UTC FreeBSD src repository Modified files: sys/dev/usb umass.c 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. Revision Changes Path 1.142 +18 -0 src/sys/dev/usb/umass.c