From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 00:45:44 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB8E716A41A; Thu, 27 Dec 2007 00:45:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 808B213C468; Thu, 27 Dec 2007 00:45:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBR0em5f039673; Wed, 26 Dec 2007 17:40:48 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 26 Dec 2007 17:45:23 -0700 (MST) Message-Id: <20071226.174523.1326317191.imp@bsdimp.com> To: henrik@gulbra.net From: "M. Warner Losh" In-Reply-To: <1198713403.1119.414.camel@Particle> References: <1198689316.1119.382.camel@Particle> <20071226.114812.1649771240.imp@bsdimp.com> <1198713403.1119.414.camel@Particle> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: stable@FreeBSD.org, freebsd-usb@FreeBSD.org, mi+kde@aldan.algebra.com Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 00:45:44 -0000 In message: <1198713403.1119.414.camel@Particle> Henrik Gulbrandsen writes: : On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote: : > In message: <1198689316.1119.382.camel@Particle> : > Henrik Gulbrandsen writes: : > : Look at it from my perspective: I would be happy to complete my fix for : > : the infamous five-year-old usb/46176, so people can finally detach umass : > : devices without having to manually unmount them first. However, it will : > : undoubtedly take a non-trivial amount of time to reproduce and eliminate : > : the remaining issues. : > : > There's no patches in this bug. : : Correct. I was hoping to have a complete fix before making any official : announcements, especially since the approach may be a bit controversial. : Fixing underlying issues one by one is not necessarily as clean as doing : a complete redesign, but it's pretty efficient and good for merging too. : : The patches to CURRENT were described in this post to the USB list: : http://lists.freebsd.org/pipermail/freebsd-usb/2007-November/004127.html These patches look good on their surface, but I want to analyse them in more detail. I had recalled seeing something like this, but I couldn't turn it up in my searching of PR database recently. I'd forgotten it was in the usb list... There's problems even when you just pop the flash card out of the adapter.. I'll see if these fix those or not... : > : I'm more likely to put in that effort if I believe : > : that my patches may actually end up in CURRENT, but if a one-line fix : > : such as that in usb/78984 has not been applied after more than a year, : > : how long will it take for patches that involve multiple subsystems? : > : > The patch in this bug is wrong. There are devices that are an odd : > number of sectors. This is one of the places where the obvious patch : > isn't necessarily right. : : You're right. I realized that myself right after I sent the first email. : The patch was already two years old when I submitted it, and I guess I : must have focused a little too much on solid-state devices with "large" : megabytes, where the sector count is very likely to be a power of two. : : The patch can be written as a quirk fix for this specific umass device, : but (as I've mentioned elsewhere) I'd prefer something that handles the : entire category of problems at once. Perhaps an extra line containing : "if (is_power_of_two(maxsector))" could be a working compromise, but : this can be discussed in a smaller setting than the current one. There's already a quirk for this problem that has been applied to the few devices that it affects. Maybe we need to add one more to the list? There was also talk of forcing a read to the last sector if the sector count was odd, but it never got past talk. Interestingly enough, I found the fact that FreeBSD's dd worked while Linux's didn't at a NIST analysis of forensic tools presented at a conference years ago. Warner